日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

saltstack执行state.sls耗时长的坑

發布時間:2025/7/14 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 saltstack执行state.sls耗时长的坑 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

? ? ? 一直用的 jenkins + saltstack 自動化構建發布項目,一共也就不超過20臺服務器,奈何運行時間越來越慢,并且負載越來越高(這里大部分都是使用state模塊),但是不用state模塊效率挺高的,所以初步鎖定坑應該在 state配置以及運行機制上.

查閱各種資料果不其然,需要注意幾點.

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

雖然我修改了minion配置里的?fileserver_limit_traversal 為true 但是效果還是不明顯,因為這個fileserver目錄里面太多文件了(node打包等一系列文件全在里面,文件數太多了(⊙﹏⊙)b),由上面的引文可見

默認情況,每次執行state文件,minion都會發出 “_file_list” 命令從master同步整個文件列表。當fileserver(即master端配置文件中file_roots設置的目錄)中的文件比較多的情況下,會增大集群負載.

再github上也搜到類似的問題,提供思路

?

參考:? ?

http://vearne.cc/?p=88

https://github.com/saltstack/salt/issues/30498

?

轉載于:https://www.cnblogs.com/loveyouyou616/p/10831623.html

總結

以上是生活随笔為你收集整理的saltstack执行state.sls耗时长的坑的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。