# Is Ansible really parallel?

**URL:** <https://forum.ansible.com/t/is-ansible-really-parallel/17042>\
**Category:** Ansible Developer\
**Tags:** ansible-devel\
**Created:** [December 12, 2014, 3:45pm UTC](https://forum.ansible.com/t/is-ansible-really-parallel/17042 "2014-12-12T15:45:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Mainguy](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Jonathan\_Mainguy](https://forum.ansible.com/u/Jonathan_Mainguy)\
**Post date:** [December 12, 2014, 3:45pm UTC](https://forum.ansible.com/t/is-ansible-really-parallel/17042/1 "2014-12-12T15:45:32Z")

</div>

Disable cowsay. Or install cowsay to fix this.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [December 12, 2014, 4:21pm UTC](https://forum.ansible.com/t/is-ansible-really-parallel/17042/2 "2014-12-12T16:21:11Z")

</div>

This is actually very easy to verify with a long running task, you can  
login on each host and see it running at the same time or just look at  
the code (one of the advantages of OSS). Ansible does things in  
parallel, currently per host (I have looked at and even modified this  
code). There are a few of reasons I can think of on why that this test  
might be misleading you.

- If the first one had to actually update packages and the 2nd one did  
not, it might account for taking the same amount of time.

- If control persist is enabled, the first one had to establish the  
connections from scratch, while the 2nd just reused them. Secure  
connections are costly and make a noticeable difference in time.

- Another reason can be locking your known\_hosts file for updates  
forces serialization of the 1st task in a play (ad-hoc command is  
really is a play of 1 task).

- Tasks that return very quickly might show more variance due to other  
factors on the local host.

---

<div class="post-metadata">

**Author:** ![Alexander\_Uvizhev](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@Alexander\_Uvizhev](https://forum.ansible.com/u/Alexander_Uvizhev)\
**Post date:** [December 12, 2014, 5:06pm UTC](https://forum.ansible.com/t/is-ansible-really-parallel/17042/3 "2014-12-12T17:06:56Z")

</div>

Thanks for your replies.  
Actually I noticed that I write to wrong mailing list. Sorry.  
I found an answer here: [http://stackoverflow.com/questions/17958949/how-do-i-drive-ansible-programmatically-and-concurrently](http://stackoverflow.com/questions/17958949/how-do-i-drive-ansible-programmatically-and-concurrently)  
and a related discussion here: [https://groups.google.com/forum/#!topic/ansible-project/8p3XWlo83ho](https://groups.google.com/forum/#!topic/ansible-project/8p3XWlo83ho)

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [December 13, 2014, 11:14pm UTC](https://forum.ansible.com/t/is-ansible-really-parallel/17042/4 "2014-12-13T23:14:20Z")

</div>

Ansible is parallel across hosts, between individual tasks (unless async fire and forget) they run in order.

The v2 code tree may enable some additional capabilities in the future.

Sometimes Ansible not seeing a _global_ known hosts file can make it think it will need to pause to answer a host keying question – newer version of Ansible also read this file and don’t have that problem.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [December 13, 2014, 11:14pm UTC](https://forum.ansible.com/t/is-ansible-really-parallel/17042/5 "2014-12-13T23:14:58Z")

</div>

Always always install cowsay 🙂
