Group_by taking 4 minutes for 2800 servers

Hi,

Is it normal for group_by to take 4 minutes to evaluate 2800 servers ?

We often start off with a group_by to simplify the playbook (and not overdesign our inventory script) and have noticed that with a large number of systems it doesn't scale very well.

Starter question: “ansible --version”

?

It was version 1.6.3, but meanwhile it seems that 1.7.2 has this fixed although I haven't confirmed it for every use-case in production. Will check on Monday.

Good deal, my other thing I’d suggest checking is whether the inventory script has the “_meta” optimization, as it may be trying to get hostvars on those hosts it has not asked about it yet.

http://docs.ansible.com/developing_inventory.html#tuning-the-external-inventory-script

Yes, we use _meta. The 4min to 5min delay we have been seeing was very clearly during the group_by task, and not the inventory-stage.

If this still poses a problem with 1.7.2, I will let you know.