My SSH server can sometimes take up to 30 seconds to accept an SSH connection. I don't have control over the server, so I can't fix this.
One of the main reasons I wanted to use mallory (instead of just an SSH tunnel done inside my python code that sends the HTTP requests) is that I wanted to spend 30 seconds connecting once, and then holding that connection open for minutes/hours/days, to make subsequent HTTP requests quick. i.e. sharing the SSH connection between multiple HTTP calls.
However I find that the round trip time through mallory is still approximately 30 seconds, which makes me suspect that a new SSH connection is being created for each HTTP request.
I tried to read the code to see how the caching of the SSH connection works, but I couldn't quite see what's happening.
How is it supposed to work?
The mallory logs show a round trip time which is approximately 40 milliseconds, when my curl command takes about 30 seconds to return. So I think the time in the logs does not include the time required to set up the SSH tunnel. Perhaps it should?
My SSH server can sometimes take up to 30 seconds to accept an SSH connection. I don't have control over the server, so I can't fix this.
One of the main reasons I wanted to use mallory (instead of just an SSH tunnel done inside my python code that sends the HTTP requests) is that I wanted to spend 30 seconds connecting once, and then holding that connection open for minutes/hours/days, to make subsequent HTTP requests quick. i.e. sharing the SSH connection between multiple HTTP calls.
However I find that the round trip time through mallory is still approximately 30 seconds, which makes me suspect that a new SSH connection is being created for each HTTP request.
I tried to read the code to see how the caching of the SSH connection works, but I couldn't quite see what's happening. How is it supposed to work?
The mallory logs show a round trip time which is approximately 40 milliseconds, when my
curl
command takes about 30 seconds to return. So I think the time in the logs does not include the time required to set up the SSH tunnel. Perhaps it should?Note that this command is slow:
But this one is fast: