Chris Church and I have been kicking around a major Windows performance fix for awhile now- I finally got around to merging our efforts together and working some of the bugs out. The result is available here: https://github.com/nitzmahone/ansible/tree/winrm_put_file . This should increase Windows module push performance by an order of magnitude, and win_copy performance by several orders of magnitude (as well as removing the restriction on the size of files that can be pushed).
Some quick n’ dirty benchmarks on this code (win_copy):
Mac->Local VM (vagrant/virtualbox), 2k/100k/1M/420M file sizes (times in seconds):
1.9.2: 4.3/15.6/74.5/(fail)
2.0.0 (this branch): 1.5/1.9/2.8/53.3
Mac->AWS-hosted (t2.micro), 2k/100k/1M/420M file sizes (times in seconds):
1.9.2: 11.8/62/553/(fail)
2.0.0 (this branch): 8.3/8.5/13.7/1244
The numbers are even better if you use the pywinrm 0.1.0 RC at https://github.com/diyan/pywinrm/tree/v0.1.x - I made a fix there that significantly improves Basic auth perf. These numbers will also improve even more once we’re using requests in pywinrm, since it supports connection keepalive. I think a big chunk of our slow WAN performance is due to renegotiating the connection on each WinRM operation.
This code still isn’t perfect (error handling and reporting, logging could be improved), but I think it’s a lot stronger than what we’re shipping now. Could I trouble some of the Windows community to try it out and give me some feedback before I shoot for a PR?
Thanks,
-Matt