4 ms·
Is Ansible slow because of Python? I had always assumed the performance was due to excessive network roundtrips.
by 0cf8612b2e1e 4y ago
Is Ansible slow because of Python? I had always assumed the performance was due to excessive network roundtrips.
- JediPig 4y agobingo. there is a flag you can set that eliminates most , if not all. It's not slow cause it's written in 'python'. It's slow because of safety.
- Octabrain 4y agoFrom my experience, it is not always just the network. Ansible can be slow in operations such as copying files between directories on the remote target. I suffered from this a couple of years ago and the solution I implemented was to delegate the copy operation to a bash script and leave Ansible to just take care of uploading that script and run it passing the configured parameters. Anyways, if the network is a problem I strongly recommend to have a look to "Ansible pull".
- thyrsus 4y agoWe're using ansible-pull. Aside from occasional access to NFS mounts, there's a minimum of network traffic. E.g., the git retrieval is usually: I've got version x. That's current? Thanks, we're done. The time is spent executing Ansible modules on the local system. 200+ tasks ok, 200+ tasks skipped, maybe 10 changed. That takes between 5 and 20 minutes. I have an unsubstantiated suspicion that the large dictionary representing the package inventory is a contributor - systems with fewer packages seem to work faster.