# Slow operations with Ansible

**URL:** <https://forum.ansible.com/t/slow-operations-with-ansible/11475>\
**Category:** Ansible Project\
**Created:** [May 1, 2012, 3:37am UTC](https://forum.ansible.com/t/slow-operations-with-ansible/11475 "2012-05-01T03:37:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_R](https://avatars.discourse-cdn.com/v4/letter/j/ec9cab/32.png) [@Jose\_R](https://forum.ansible.com/u/Jose_R)\
**Post date:** [May 1, 2012, 3:37am UTC](https://forum.ansible.com/t/slow-operations-with-ansible/11475/1 "2012-05-01T03:37:06Z")

</div>

Hello,

I'm doing some basic commands: mkdir, chmod, copy, etc... and most of  
the commands run slowly.

Is there a way to speed things up? If it requires code changes that  
need to be implemented, what possible strategy to improve the code is  
available to make these command execute faster? Thoughts?

I like ansible's concepts and would like to continue using it if it  
were faster.

-J

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [May 1, 2012, 12:18pm UTC](https://forum.ansible.com/t/slow-operations-with-ansible/11475/2 "2012-05-01T12:18:45Z")

</div>

First off, you didn’t specify what branch you were using.

If you are using sudo mode, in particular on the master branch, sudo is somewhat primitive. It is VASTLY improved on the development branch, where various sleeps have been replaced by proper parsing logic.  
Let me know if that’s the case.

Another thing you may be interested is Ansible in --connection=local mode (also development branch), where we’re going to implement some very nice things to bootstrap Ansible normally and then run it in pull mode  
over cron. This is going to be FANTASTIC for repeated configuration management and is already in work, though we’re still hashing some details out. It will scale easily to tens of thousands of nodes but still be easy  
to install in even existing environments that aren’t configured with any CMS whatsoever.

Generally (if not using master branch sudo), I don’t find Ansible to be slow for me at all, so you may have some random network issues on your end. There has been some work to reduce the number of various  
operations, but these are not orders of magnitude differences. Some optimization can still be done around reusing tempdirs thus reducing the need for some mktemp and delete operations, which would probably  
improve general SSH operations by about 25%. It’s also on my rather distant radar to support additional transports as an option (i.e. message buses and such) but I think SSH is so appealing for so many different  
reasons (security, no bootstrap, cloud) that the local connection mode and using Ansible to set up ansible in pull mode is the most elegant solution.

More details welcome!

–Michael
