# Slow fact gathering or slow winrm on windows hosts

**URL:** <https://forum.ansible.com/t/slow-fact-gathering-or-slow-winrm-on-windows-hosts/19471>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [October 9, 2015, 1:46pm UTC](https://forum.ansible.com/t/slow-fact-gathering-or-slow-winrm-on-windows-hosts/19471 "2015-10-09T13:46:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Baydoun](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Michael\_Baydoun](https://forum.ansible.com/u/Michael_Baydoun)\
**Post date:** [October 9, 2015, 1:46pm UTC](https://forum.ansible.com/t/slow-fact-gathering-or-slow-winrm-on-windows-hosts/19471/1 "2015-10-09T13:46:52Z")

</div>

A few of our windows hosts take 20-30 seconds to gather facts, and that’s the good news. The other hosts take \> 1 minute just to gather facts.  
When run with -vvvv, it appears to me that every winrm step just takes a long time.

Has anyone run into this? Suggestions? Adding each windows host to our inventory is causing painful increases in site.yml run time.  
Note: running ansible 1.9.2, and hoping 2.0 will improve the situation when it’s released

I wrote a test to gather run times for fact gathering, results for windows hosts below (with hostnames removed)

min:sec:hundredths

0:26.66

1:13.46  
1:15.47  
1:14.77  
1:33.89  
0:32.68  
2:44.04  
1:34.65  
1:30.29  
1:25.71  
0:29.66  
0:25.86  
1:08.95  
1:09.38  
0:21.88  
0:24.47

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [October 9, 2015, 4:01pm UTC](https://forum.ansible.com/t/slow-fact-gathering-or-slow-winrm-on-windows-hosts/19471/2 "2015-10-09T16:01:49Z")

</div>

There’s no getting around the fact that winrm is a much slower protocol than ssh. Those numbers seem unreasonably high tho. Any chance you’re using a local ansible control node against cloud-based windows servers?

You could also consider speeding up your playbooks using the “forks” ([http://www.ansible.com/blog/ansible-performance-tuning](http://www.ansible.com/blog/ansible-performance-tuning))

---

<div class="post-metadata">

**Author:** ![Michael\_Baydoun](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Michael\_Baydoun](https://forum.ansible.com/u/Michael_Baydoun)\
**Post date:** [October 9, 2015, 4:21pm UTC](https://forum.ansible.com/t/slow-fact-gathering-or-slow-winrm-on-windows-hosts/19471/3 "2015-10-09T16:21:31Z")

</div>

All servers are local in this building. Will look at increasing forks even more than we already have, though limited in what we can do until 2.0 is released and allows for per task serial values.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [October 9, 2015, 4:50pm UTC](https://forum.ansible.com/t/slow-fact-gathering-or-slow-winrm-on-windows-hosts/19471/4 "2015-10-09T16:50:49Z")

</div>

there is no plan to allow per task serial, it is not a feature in 2.0.

you can easily add a play in the middle of a playbook for such tasks  
that need a change in the 'serial' setting

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [October 9, 2015, 8:15pm UTC](https://forum.ansible.com/t/slow-fact-gathering-or-slow-winrm-on-windows-hosts/19471/5 "2015-10-09T20:15:23Z")

</div>

That’s unusual. For non-wan connections we are usually looking at max 3 seconds for the setup module. What happens when you set up a psremoting session from a windows computer to the same nodes, hows performance?
