I've been testing with quick and dirty 
https://github.com/lassizci/ansible-perftest quite frequently with 
different versions including the current dev, and it seems 2.4 series (no 
huge differences with the exact versions) is slightly slower at it's best 
and somewhat 50% slower at worst. Unfortunately these don't seem to get any 
attention. What makes it worse is the lack of scalability with forks and 
also the bigger the inventory, the less reliable ControlMaster seems to 
get, so this results in additional slowdowns.

On Thursday, November 23, 2017 at 4:15:49 PM UTC+2, Andrea Carpani wrote:
>
> Version: Ansible 2.3.1.0
>
> Hello,
>
> I'm using Ansible with a small/medium sized inventory and accessing 
> hostvars is painfully slow. I think problems began when switching 2.1 -> 
> 2.3, but I have no easy way of verifying this.
> Playbooks became incredibly slow while rendering templates. One particular 
> template became unusable since the task takes now 40 minutes. I 
> investigated the issue by analyzing this template and came to the 
> conclusion that each access to hostvars[something] takes ~1sec.
> I'm positive the template could be improved, but the core problem would 
> still be there. 
>
> Just to give an idea about what I mean by slow, here's the time it took to 
> process the same operation on lab and prod inventory:
>
> $ ansible -i lab.inv all --list-hosts |wc -l
> 16
>
> $ time ansible -i lab.inv all -m debug -a var=hostvars |wc -l
> 163740
>
> real    0m2,455s
> user    0m5,462s
> sys    0m0,948s
>
> $ ansible -i prod.inv all --list-hosts |wc -l
> 257
>
> $ time ansible -i prod.inv all -m debug -a var=hostvars |wc -l
> ctrl-c 
> I've stopped it after 1h.
>
> I've found quite a few issues related to this but I've not been able to 
> understand if the issue was addressed or resolved at all. Apparently not.
>
> https://github.com/ansible/ansible/issues/12239 (opened in 2015)
> https://github.com/ansible/ansible/issues/23349 (2017)
> https://github.com/ansible/ansible/issues/30773 (2017)
>
> Having to manage 200+ servers in production should not be that uncommon: 
> how do I get out of this issue? I've currently found this workaround 
> https://github.com/ansible/ansible/issues/17528#issuecomment-255065629 , 
> but it's obviously an ugly hack.
> Would 2.4 help?
>
> Thanks.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9d71c55d-3b52-473d-b136-45cfe3549b1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to