我从AnsibleTower运行脚本,并使用WinRM在Windows机器上执行它。这个脚本只创建一个目录。运行它需要8-10秒。
在一些完全不同的环境中,它需要< 1s。
,在运行这些任务需要8-10秒的环境中,会有什么问题吗?
- hosts: the_test_host
tasks:
- name: Create 1st file
win_file:
path: D:\test_1.txt
state: touch
- name: Create 2nd file
win_file:
path: D:\test_2.txt
state: touch
- name: Create 3rd file
win_file:
path: D:\test_3.txt
state: touch
- name: Create 4th file
win_file:
path: D:\test_4.txt
state: touch
- name: Create 5th file
win_file:
path: D:\test_5.txt
state: touch发布于 2021-08-26 16:29:12
剧本开始放缓的主要原因是事实收集。关掉它:
- hosts: the_test_host
gather_facts: false
tasks:
...其他问题可能是网络(延迟),gss模块(对于centos,如果可能的话禁用它)。
如果你渴望速度,你可以尝试使用连接复用和有丝分裂,但两者都需要相当多的关注,并将产生一些令人不快的惊喜。
https://stackoverflow.com/questions/68937563
复制相似问题