Sunday, January 29, 2012

Speeding up Matlab over X11 Forwarding

Running Matlab over ssh is handy. If one wants to use the GUI, X11 forwarding is possible, but it is painfully slow if both machines are not inside a local network.

I found information about how to speed it up after googling for a while. In the end I think it is worth it to summarize the steps here:
  • In the current folder where you are going to run matlab from, create a file name java.opts with the content 
                   "-Dsun.java2d.pmoffscreen=false" (without the double commas).
  • Use compression with ssh, by connecting to the server with
                      ssh -c arcfour,blowfish-cbc -Y -C username@server

The speed up obtained is particularly noticeable when changing focus between different windows in the Matlab GUI.