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 https://ara.readthedocs.io/en/latest/ and joining us on Slack or IRC: https://ara.recordsansible.org/community/ -->
<!-- Include relevant information to help the community help you. Some examples:
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:
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:
There is a similar issue for the measure API server performance here: https://github.com/ansible-community/ara/issues/170
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.