Ask questionsMeasuring and improving callback plugin performance

<!-- Thank you for taking the time to create this issue. Your feedback is appreciated ! --> <!-- Consider reading the documentation on and joining us on Slack or IRC: -->

What is the idea ?

<!-- Include relevant information to help the community help you. Some examples:

  • the component that you are creating this issue about (api server, api client, web ui, ansible plugins, etc.)
  • linux distribution, version of python, version of ara and ansible
  • how is ara installed (from source, pypi, in a container, etc.) and how you are running it (database backend, wsgi server, etc.)
  • debugging logs by setting ARA_DEBUG to True and ARA_LOG_LEVEL to DEBUG
  • instructions on how to reproduce the issue -->

There is a performance overhead between running Ansible with and without ara the ara callback because for every hook, instead of doing nothing, Ansible does this: doc/source/_static/graphs/recording-workflow.png

Doing something, even if it's very fast, takes longer than doing nothing... because it adds up when the cost is multiplied by thousands of times across the execution of a larger playbook. So there will always be an overhead (sorry!) but it should be low enough that it's hopefully worth it to the humans :)

The main issue is that the overhead is exponential due to the multiplication of hosts and tasks. This means at a small scale it will be low enough to be negligible but a real performance hit when running playbooks involving hundreds of hosts or thousands of tasks.

I'm sure there are improvements we could do to reduce this overhead in the current callback, the API clients or the API server and come up with other implementations with fancy stuff like async, threads, or even dropping the events into a local message bus for lowering the latency to a maximum.

Before we start optimizing stuff, I'd like to measure the overhead even if just for the sake of data, metrics and science.

I think a good start would be:

  • raw ansible-playbook
  • ansible-playbook with 1.x ara callback enabled
  • ansible-playbook with 0.x ara callback enabled (for science and comparison purposes, 0.x doesn't have an API server)

There is a similar issue for the measure API server performance here:


Answer questions andrask

Would it be possible to make the reporting asynchronous? That is, send data to the API server asynchronously and let the playbook run on its own pace.

Github User Rank List