Fork me on GitHub

版权声明 本站原创文章 由 萌叔 发表
转载请注明 萌叔 | https://vearne.cc

当整个saltstack的负载比较高的时候需要修改如果配置参数

1. Minion

By default, the Salt fileserver recurses fully into all defined environments
to attempt to find files. To limit this behavior so that the fileserver only
traverses directories with SLS files and special Salt directories like _modules,
enable the option below. This might be useful for installations where a file root
has a very large number of files and performance is negatively impacted. Default
is False.

# 关闭软连接
fileserver_followsymlinks: False
# 忽略软连接
fileserver_ignoresymlinks: True
# 见上面的引文
fileserver_limit_traversal: True

默认情况,每次执行state文件,minion都会发出 "_file_list" 命令从master同步整个文件列表。当fileserver中的文件比较多的情况下,会增大集群负载

2. Master

These two ZMQ HWM settings, salt_event_pub_hwm and event_publisher_pub_hwm
are significant for masters with thousands of minions. When these are
insufficiently high it will manifest in random responses missing in the CLI
and even missing from the job cache. Masters that have fast CPUs and many
cores with appropriate worker_threads will not need these set as high.

On deployment with 8,000 minions, 2.4GHz CPUs, 24 cores, 32GiB memory has
these settings:

salt_event_pub_hwm: 128000
event_publisher_pub_hwm: 64000

# ZMQ high-water-mark for SaltEvent pub socket
salt_event_pub_hwm: 128000

# ZMQ high-water-mark for EventPublisher pub socket
event_publisher_pub_hwm: 64000

saltstack 默认配置建议,如果saltstack管理的机器较多,可以调整以上2个配置, 如果设置的过小,消息消费的不及时,zeromq可能会主动丢弃消息。

参考资料

  1. SaltStack丢消息的根本原因
  2. Missing Message Problem Solver

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注