warpgate: Ansible connections using warpgate are slow
I just noticed that when I use Ansible with Warpgate the playbook execution time is slower.
Test setup
I run a playbook against the host where warpgate is installed via systemd. For the authentication with Ansible I used the password login for warpgate. For the test without warpgate I used a ssh private key to connect to the target host directly by Ansible. I then run the Ansible playbook with the time command to measure the time it took to complete.
Results:
warpgate (ssh with password auth):
real 0m44.063s
user 0m3.355s
sys 0m0.567s
warpgate (ssh with key auth):
real 0m28.975s
user 0m2.655s
sys 0m0.414s
direct:
real 0m4.923s
user 0m1.212s
sys 0m0.338s
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 30 (12 by maintainers)
Commits related to this issue
- ssh: remove auth delay after initial "none" auth - #459 — committed to warp-tech/warpgate by Eugeny 2 years ago
- fixed missing CHANNEL_CLOSE messages - #459 — committed to warp-tech/warpgate by Eugeny 2 years ago
This is great - thank you so much for testing!
@Eugeny I just tested the fix and it works perfectly, I changed back the MaxSessions back to 10 and let a playbook run and one warpgate sessions was used with more then 10 recordings 👍
I’ve just found out that Warpgate didn’t correctly close SSH channels - leading to
MaxSessionsgetting exhausted - now the whole playbook should run through the same connection@Eugeny I just tested it with the test script I had written and the times for direct ssh and warpgate are basically identical.
Just a few samples: SSH:
Warpgate:
I went to actually collect the data and discovered that speed is not the issue (at least not a primary issue). It seems like the connection is being dropped for some reason. I give details here: https://github.com/warp-tech/warpgate/issues/479 but I believe the issue can be reproduced simply by transferring a file of non-trivial size using
scp(unless the issue is somehow unique to my setup). Funnily enough,rsyncworks just fine and is exactly as fast between a direct connection, a jumphost, and a Warpgate host.Nice!
I actually found something out, I tested ansible in combination with mitogen https://mitogen.networkgenomics.com/ansible_detailed.html which only uses 1 persistent ssh connection for the entire playbook run against a given host (this is also visable in warpate since only one sessions is logged with one ssh recording). Where Ansible opens a new connection per task which is probably what makes it so slow. Using mitogen I had really really fast ansible playbook times. But I will post more details later, first need to do more tests. I also want to try to use the ssh ControlMaster feature. The only problem is that mitogen is kind of a patch for Ansible so it always takes time for them to catch up with upstream.