On 12.12.2018 07:53, pradeep.hk wrote:
I have a requirement to run lots of playbooks parallely on localhost.
When I run 100 playbooks parallely (a simple one that executes the a
shell
command - date) , I see that
it consumes lot of resources (memory ~ 7GiB and CPU ~ 200%)
Is this on expected lines ?
It sound about right.
For small execution Ansible uses about 50MB of memmory, 50MB * 100 is
about 5GB.
But since you are running the same playbook on the same host you could
instead do this
In inventory add
[testgroup]
testhost[001:100
And in ansible.cfg set fork=100
And the playbook
- hosts: testgruop
connection: local
gather_facts: no
tasks:
- name: Get date
shell: date
register: result
- debug:
var: result.stdout
This will only use a little over 50MB and not GB of memory and a lot
less CPU.
Your test case seams to me not very relevant, but if it is, let Ansible
fork and not the OS.
--
Kai Stian Olstad
--
You received this message because you are subscribed to the Google Groups "Ansible
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/992876c95ffe2feee27fedab5439667a%40olstad.com.
For more options, visit https://groups.google.com/d/optout.