Ssh – Why is an application via ‘ssh -X’ slower than vncviewer via ‘ssh -X’

sshvncxforwarding

If I run a programm via x-forward it performs very bad when it comes to animations. E.g.:

ssh -X <USER>@<SERVER> "application"

But if I start a remote vnc server and connect to it remotly via ssh, then the animations and all the other stuff runs much smoother. E.g.:

DSPLY=1 && ssh -X <USER>@<SERVER> "vncserver :$DSPLY ; vncviewer localhost:$DSPLY"

In my opinion it is (more or less) the same amount of data which needs to be transmit via ssh. So why is there such a big difference in speed?

Best Answer

The problem is most likely the X protocol itself. It is very chatty and while the raw amaount of data is rather small, it causes many round trips which become a problem over WAN connections.

Your construct starts a remote xserver which the application you want to use is connecting to. So from the point of view of the application the xserver is local and the round trip delays are small. From an architectural point of view, vnc windows are very simple, hence your vncviewer window needs a lot less chat and round trips to work properly, compared to "real" applications.

Furthermore even the classical vnc implementations target specifically this RTD problem by proactively reducing the required chat, which also results in reduced chat between the vncviewer window and your local xserver.

Related Question