Hi, Is there any way to speedup the playbooks execution of openstack ansible ? Can we remove gather facts for any tasks without affecting the installation ?
Hi, Facts gathering happens once per playbook and at specific points during the execution where a stale facts cache is known to cause errors, it does not occur per task. The current facts gathering in openstack-ansible is optimised to gather a minimum set of facts to have the least impact on runtime possible. Jonathan. There not really any way to escape ansible being relatively slow to execute. On 28/02/2024 14:44, Gk Gk wrote:
Hi,
Is there any way to speedup the playbooks execution of openstack ansible ? Can we remove gather facts for any tasks without affecting the installation ?
On Wed, Feb 28, 2024, at 9:18 AM, Jonathan Rosser wrote:
Hi,
Facts gathering happens once per playbook and at specific points during the execution where a stale facts cache is known to cause errors, it does not occur per task.
The current facts gathering in openstack-ansible is optimised to gather a minimum set of facts to have the least impact on runtime possible.
Jonathan.
There not really any way to escape ansible being relatively slow to execute.
There are things that can be done when writing Ansible to make it run quicker though. For example: avoiding Ansible loops as each loop iteration incurs the overhead of task startup. Unfortunately, Ansible's linter has pushed towards a style that relies on Ansible control flow and modules for execution over say shell scripts that can handle things in a single task avoiding any looping. As a side note the performance in Ansible has gotten worse over time. In particular the per task overhead seems to have skyrocketed. I also think that the -f flag's impact may have been reduced because Ansible stopped preforking processes and instead forks on demand which creates more noticeable overhead. It has been a while since I looked at this closely and it may have since changed again though.
On 28/02/2024 14:44, Gk Gk wrote:
Hi,
Is there any way to speedup the playbooks execution of openstack ansible ? Can we remove gather facts for any tasks without affecting the installation ?
You could experiment with Mitogen [0] but beware that it may not support everything that openstack-ansible uses. 0 - https://mitogen.networkgenomics.com/ansible_detailed.html Giovanni ________________________________________ From: Gk Gk <ygk.kmr@gmail.com> Sent: Wednesday, February 28, 2024 11:44 To: openstack-discuss Subject: Ansible performance You don't often get email from ygk.kmr@gmail.com. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification> Hi, Is there any way to speedup the playbooks execution of openstack ansible ? Can we remove gather facts for any tasks without affecting the installation ?
Mitogen known not to work, and while trying to adopt it, it has shown performance degradation comparing to our in-house connection plugin which handles connection to containers through the host as well (if I'm not mistaken). And yes, eventually the only way to reduce runtime with current state of the Ansible is reducing amount of tasks, through basically replacing some roles just with custom modules. But that kinda raises bunch of other concerns/considerations to make. One of which would be, that code will become hardly understandable for anyone, who is not actively involved in a project development. While currently it is enough for operator to know only Ansible, big amount of custom modules will raise entrance bar needed, including contributions. On Wed, Feb 28, 2024, 21:40 Giovanni Tirloni <giovanni.tirloni@vexxhost.com> wrote:
You could experiment with Mitogen [0] but beware that it may not support everything that openstack-ansible uses.
0 - https://mitogen.networkgenomics.com/ansible_detailed.html
Giovanni
________________________________________ From: Gk Gk <ygk.kmr@gmail.com> Sent: Wednesday, February 28, 2024 11:44 To: openstack-discuss Subject: Ansible performance
You don't often get email from ygk.kmr@gmail.com. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification> Hi,
Is there any way to speedup the playbooks execution of openstack ansible ? Can we remove gather facts for any tasks without affecting the installation ?
participants (5)
-
Clark Boylan
-
Dmitriy Rabotyagov
-
Giovanni Tirloni
-
Gk Gk
-
Jonathan Rosser