首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >游戏手册中的每一项任务都需要10s才能启动。

游戏手册中的每一项任务都需要10s才能启动。
EN

Stack Overflow用户
提问于 2021-08-26 11:18:35
回答 1查看 345关注 0票数 0

我从AnsibleTower运行脚本,并使用WinRM在Windows机器上执行它。这个脚本只创建一个目录。运行它需要8-10秒。

在一些完全不同的环境中,它需要< 1s。

,在运行这些任务需要8-10秒的环境中,会有什么问题吗?

代码语言:javascript
复制
- 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
EN

回答 1

Stack Overflow用户

发布于 2021-08-26 16:29:12

剧本开始放缓的主要原因是事实收集。关掉它:

代码语言:javascript
复制
- hosts: the_test_host
  gather_facts: false
  tasks:
    ...

其他问题可能是网络(延迟),gss模块(对于centos,如果可能的话禁用它)。

如果你渴望速度,你可以尝试使用连接复用和有丝分裂,但两者都需要相当多的关注,并将产生一些令人不快的惊喜。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68937563

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档