Improving VNC Performance

This page is a work in progress, use the information here if it helps, but do not consider it in any way authoritative.

  1. Greg Priest-Dorman 2010/05/04 09:36

VNC is sending the image of your screen over the network between the server (here at CS) and your client (the machine where you are working). Depending on the network speed, the load on the server, the speed of your machine and the protocols vnc is trying to follow, the speed of your vnc session can range from “zippy” to “unusable”.

  1. You can make sure your session on our server is not putting any more demands on the server than it needs to, this way our server will be giving you the best performance it can.
  2. You can make sure your session is not more graphically demanding than it needs to be reducing the amount of information sent.
  3. You can make sure your vnc client is using an encoding/compression scheme other than “raw” so it does not try to redraw the entire screen any time one pixel changes!
  4. You can try adding ssh compression, sometimes this helps as well. Some folks find they get better performance with ssh compression boosting vnc encoding, others report that ssh compression does not add or actually slows performance over vnc encoding alone. You may just have to try and find out for yourself.

To make sure you are not trying to push any more data over the connection than you need to push.

  • Don't pick a bigger window or higher resolution than you need. If you are doing drscheme, you don't need a 1280×1024 window. A 1024×768 window is sending much less data. Also, 16 bit color may do fine. To draw your window at 1280×1024 at 24 bit depth can take more than 400 times the data of 1024×768 at 16 bit! You pick the resolution and bit depth of your session by choosing the port to connect over. To see what port to use when setting up your tunnel, consult: resolution. If unsure, port 5995 or 5996 is a good place to start (1024×768 at 16bit, or 1024×768 at 24bit).
  • Make your window manager ``XFCE Session``
    1. Before you log in and after you start your vnc client, select ``session`` (right under where you enter your username).
    2. select ``XFCE Session`` as this window manager uses fewer resources than many.
    3. Now log in as usual.
    4. Once logged in, bring up the settings manager either by menu or by typing ``xfdesktop-settings`` in a terminal in your vnc session. Don't worry about any warnings you may see that start “Xlib: extension…” they are because the vnc session does not have some of the display capabilities that a local graphics card has.
    5. In the Desktop settings window of your vnc session, make your background a solid color. In this way vnc does have to keep refreshing an image.
    6. select ``Close`` in the Desktop settings window of your vnc session.

Our vnc server supports a number of compression protocals, the problem is that by default your vnc client may not be using any of them. Your client will likly have one of two ways to enable them.

Enabling Encoding in a GUI vnc client

If you are using a Graphical Menu based client then it should have a ``preferences``, ``settings`` or ``options`` button or menu item. There you should find compression or encoding options with names like “hextile”, “copyrect”, “zilb” and “tight”. Try any or all of these.

Enabling Encoding in a CLI vnc client

If you are starting your vnc client at a command line, then it should take encoding options on the command line. The way it does this will depend on the client. Here are a few popular clients, if yours is not here, please consult the documentation on your system.

  • ``xvnc4viewer`` takes the option “-AutoSelect”.
  • ``xtightvncviewer`` takes the option “-encodings” followed by a list of encodings to try in order of preferance. Enclose the list in quotes, for example if your tunnel connects to localhost:1 you would do

xtightvncviewer -encodings “tight zlib hextile copyrect” localhost:1