【问题标题】:How to debug performance of salt-ssh如何调试 salt-ssh 的性能
【发布时间】:2016-07-20 13:13:53
【问题描述】:

我对 salt-ssh 在我的上下文中的表现不满意。

只需一些必要条件,非常小的更改最多需要 30 秒。

我想找到瓶颈。

如果我打电话给salt-ssh,就会发生这些步骤:

  1. 到 root@minion 的 ssh 连接
  2. thin.tgz 被转移
  3. 解析必要条件树
  4. 树被应用
  5. 从 minion 返回结果。
  6. 在本地主机上收到结果

我猜这不是 100% 正确,如果这些步骤需要更新,请离开 cmets。

我想知道salt-ssh每个步骤需要多长时间。

有人知道如何调试吗?

salt:/srv # salt --versions-report
Salt Version:
           Salt: 2016.3.1

Dependency Versions:
           cffi: 0.8.6
       cherrypy: Not Installed
       dateutil: 2.1
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: 0.21.0
        libnacl: Not Installed
       M2Crypto: 0.22
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.7
   mysql-python: Not Installed
      pycparser: 2.10
       pycrypto: 2.6.1
         pygit2: 0.21.2
         Python: 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC]
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.3
            ZMQ: 4.1.2

System Versions:
           dist: SuSE 12.3 x86_64
        machine: x86_64
        release: 3.7.10-1.40-desktop
         system: Linux
        version: openSUSE  12.3 x86_64

【问题讨论】:

    标签: performance ssh salt-stack


    【解决方案1】:

    -l debug 添加到您的salt-ssh 命令应该会为您提供大量信息,这些信息可能会帮助您确定需要这么长时间的原因。

    另外,salt-ssh --versions-report 的输出是什么?

    【讨论】:

    • -l debug 打印了很多消息。我可以将其中一些行与问题中的高级步骤相匹配。到目前为止,我在日志中看不到时间戳。有没有办法格式化日志以包含时间戳? ...我将版本报告添加到问题中。
    【解决方案2】:

    如果您想查看每个状态的时序数据,您可以在 config/master 中启用 state_output_profile。

    # On some minions, we get weird output from state.apply
    # salt issue #35989 workaround - temporary until 2016.11.0 release
    # https://github.com/saltstack/salt/issues/35989#issuecomment-250611386
    # state_output_profile: 'True|False'
    

    【讨论】:

      猜你喜欢
      • 2018-09-05
      • 2021-08-03
      • 2020-04-21
      • 1970-01-01
      • 2018-01-31
      • 2011-11-23
      • 1970-01-01
      • 2012-05-26
      • 1970-01-01
      相关资源
      最近更新 更多