# Group\_by taking 4 minutes for 2800 servers

**URL:** <https://forum.ansible.com/t/group-by-taking-4-minutes-for-2800-servers/16456>\
**Category:** Ansible Project\
**Created:** [October 7, 2014, 3:14pm UTC](https://forum.ansible.com/t/group-by-taking-4-minutes-for-2800-servers/16456 "2014-10-07T15:14:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dag\_Wieers](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dag\_Wieers](https://forum.ansible.com/u/Dag_Wieers)\
**Post date:** [October 7, 2014, 3:14pm UTC](https://forum.ansible.com/t/group-by-taking-4-minutes-for-2800-servers/16456/1 "2014-10-07T15:14:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 9, 2014, 8:39pm UTC](https://forum.ansible.com/t/group-by-taking-4-minutes-for-2800-servers/16456/2 "2014-10-09T20:39:31Z")

</div>

Starter question: “ansible --version”

?

---

<div class="post-metadata">

**Author:** ![Dag\_Wieers](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dag\_Wieers](https://forum.ansible.com/u/Dag_Wieers)\
**Post date:** [October 9, 2014, 8:44pm UTC](https://forum.ansible.com/t/group-by-taking-4-minutes-for-2800-servers/16456/3 "2014-10-09T20:44:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 9, 2014, 8:57pm UTC](https://forum.ansible.com/t/group-by-taking-4-minutes-for-2800-servers/16456/4 "2014-10-09T20:57:49Z")

</div>

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](http://docs.ansible.com/developing_inventory.html#tuning-the-external-inventory-script)

---

<div class="post-metadata">

**Author:** ![Dag\_Wieers](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dag\_Wieers](https://forum.ansible.com/u/Dag_Wieers)\
**Post date:** [October 9, 2014, 11:00pm UTC](https://forum.ansible.com/t/group-by-taking-4-minutes-for-2800-servers/16456/5 "2014-10-09T23:00:41Z")

</div>

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.
