Ansible Windows Connections - 4 second initialization? Pipelining?

66 views
Skip to first unread message

Amir Luzon

unread,
Apr 2, 2015, 8:53:48 AM4/2/15
to ansible...@googlegroups.com
Hi guys,

I'm doing a POC of Ansible for my company. We have a mixture of Linux and Windows servers.While playing around with windows i found that just running a simple powershell script which does "exit 0" will take about 4 seconds every time.

I am not sure why this is the case, i tried to enable Pipelining but it seems that this is for SSH connections only and not for windows Powershell connections.

here is an example run i did:

PLAY RECAP ********************************************************************
base | Unzip Package --------------------------------------------------- 24.62s
Update Web.Config2 ------------------------------------------------------ 3.85s
Update Web.Config1 ------------------------------------------------------ 3.82s
Update Web.Config3 ------------------------------------------------------ 3.78s

The "Update Web.Config" tasks just run the simple powershell script which basically does nothing.

Since we are testing Ansible as a viable CI component I will need to solve this or else Ansible will not be viable for our usages due to the overkill of 4 seconds per task.

Can anyone please assist?

Chris Church

unread,
Apr 2, 2015, 9:22:39 AM4/2/15
to ansible...@googlegroups.com
Hi Amir,

The biggest issue here is that the pywinrm library uses urllib2, which doesn't natively support keep-alive connections.  Due to the way PowerShell remoting works, each command requires at least 4 HTTP requests and must make a new connection for each one.

I have a fork of pywinrm using requests instead, which seems to help significantly with performance.  I need to find time to finish up a few parts of it, but you're welcome to try and see how it works for you.



--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/55d7d6a7-75d5-4cb4-8454-876f342d78bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages