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.

https://github.com/cchurch/pywinrm/blob/transport-refactor/winrm/requests_transport.py



On Thu, Apr 2, 2015 at 4:35 AM, Amir Luzon <[email protected]> wrote:

> 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?
>
> --
> 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/55d7d6a7-75d5-4cb4-8454-876f342d78bf%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/55d7d6a7-75d5-4cb4-8454-876f342d78bf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAH%2BKTJ4V%2B%3DW657EJoXvQfB2h%3DFnfnkWzpL7875RfQP5osBT1Xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to