I have noticed that on my office's network, multi-hop SSH connections using the "pseudo-tty" method perform better (see last note) than using the "forwarding" method. Why would this be the case?

In other words, why would:

ssh -A -X -tt server1 ssh -X -tt server2  # pseudo-tty

result in much better performance than:

ssh -o ‘ProxyCommand=ssh -A -X -W %h:%p server1’ -X server2  # forwarding


Other notes:

  • I'm on my laptop, and server1 and server2 have the same hardware.
  • On my laptop, I've got Windows 7 with Cygwin's ssh and xwin. It has a decent processor (i7 4610M or similar).
  • Both server1 and server2 are RHEL 6.5.
  • I haven't measured bitrate, but X11 apps are significantly faster with the pseudo-tty method (there's visible delay with forwarding).
  • Can you give it a try with native windows version? I know that Cygwin does quite enough of magic to emulate various Linux stuff and I believe there will be some of it for X forwarding. – Jakuje Jan 1 '16 at 18:53
  • Have you tried automatic proxy as well, that should have less overhead than your both other options. I am not sure why there should be much difference between your mentioned two methods. – eckes Jun 5 '17 at 9:26

I think your first command-line will estalish a connexion to server1 optimized for interactive session (with lowdelay response, but less troughtput), but the forwading method will open a session with ToS bit set to MaximizeTroughtput, with higher response time. Thus less optimized for interactive sessions.

That may come from the fact that ssh and sshd will automatically set the ToS as per rfc1349. The default is lowdelay for interactive sessions and throughput for non-interactive (usually sftp, scp, in your case port forwarding).

Extract from man ssh_config:

 IPQoS   Specifies the IPv4 type-of-service or DSCP class for connections.  Accepted values are af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, cs0, cs1, cs2, cs3, cs4, cs5, cs6, cs7, ef, lowdelay,
         throughput, reliability, or a numeric value.  This option may take one or two arguments, separated by whitespace.  If one argument is specified, it is used as the packet class unconditionally.  If two values are speci‐
         fied, the first is automatically selected for interactive sessions and the second for non-interactive sessions.  The default is lowdelay for interactive sessions and throughput for non-interactive sessions.

ps: you may try:

ssh -o ‘ProxyCommand="ssh -A -X -W %h:%p -o IPQoS=lowdelay server1"’ -X server2

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.