large amount of memory utilization slows down ansible execution as part of the deployment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
In Progress
|
High
|
Alex Schultz |
Bug Description
When running ansible against a large number of hosts and you gather all the facts, the task execution of the deployment will slow down. The more memory used, the slower the deployment taks. This can be seen even with the most basic of playbooks:
- hosts: all:!compute-
gather_facts: false
name: clear cached facts
tasks:
- meta: clear_facts
- hosts: all:!compute-
name: gather facts
gather_facts: false
any_errors_fatal: true
become: false
tasks:
- setup:
- '!all'
- 'min'
- hosts: all:!compute-
gather_facts: false
tasks:
- name: Sleep task 1
shell: sleep 1
In order to reduce this impact in TripleO, we should gather more information than required to perform the actions. Additionally we should not use any of the package or service fact methods. A compute node that has a running workload can have network facts that exceed 1 MB for a single host. When you multiple this by 200 compute nodes, the ansible usage just for facts in memory would be 200M. The same set of hosts with only collecting !all,min results in ~2MB in facts for all hosts instead.
Changed in tripleo: | |
status: | Triaged → In Progress |
Changed in tripleo: | |
milestone: | wallaby-3 → wallaby-rc1 |
Changed in tripleo: | |
milestone: | wallaby-rc1 → xena-1 |
Changed in tripleo: | |
milestone: | xena-1 → xena-2 |
Changed in tripleo: | |
milestone: | xena-2 → xena-3 |
> Additionally we should not use any of the package or service fact methods.
Are we saying that any kind of fact gathering should be avoided (or just service/package facts), as it's multiplied by number of nodes and adds to ansible controller memory usage (~32GB RAM is not enough)? I can't see anything in service_facts[1] module that can lead to high memory usage though.
[1] https:/ /github. com/ansible/ ansible/ blob/devel/ lib/ansible/ modules/ service_ facts.py