Hi guys! I’ve been using VNC to connect all my computers together on my network, but I noticed that my mac with Vine server is much slower than any of my Linux computers. So I made a network test to compare the performance.
Mac server: OSX 10.4.10 with Vine Server 2.2 running on 2.2GHz Core 2 Duo (MA895LL/A) 1440x900
Linux server: Ubuntu 7.04 with vnc4server 4.1.1 running on 2.2GHz Athlon 64 (single core) 1600x1200
Client: Windows XP x64 running TightVNC 1.3.9 running on 2.2GHz Athlon X2 (dual core) 2560x1600
Network: Gigabit ethernet with all computers running with 9000-byte jumbo frames.
The test was to see how long it took for one full screen refresh in raw encoding mode. I ran Wireshark on the client computer then started up the VNC viewer and exited when the whole screen is drawn. Then I read through the Wireshark log to see how long it took to send the whole screen.
What I found is that Vine Server will send exactly 5 lines of the screen very quickly (around 0.2ms), but then it will stall for about 6ms before sending the next batch of 5 lines. Although 6ms doesn’t sound like a lot, since there are 900 lines on the screen, 900 / 5 * 6 = 1080ms, which is over 1 second of delay per frame.
The Linux computer, on the other hand, does not have the same delay, and gets done with 1 frame in about 0.1s. It looks like some of the packets got lost along the way, though… not sure why.
I also did some tests at non-native resolutions and found that the number of lines sent before the delay changed depending on the resolution. I found out that:
- The number of bytes sent always represents an integral number of lines. That is: mod(bytes_sent, 4 * res_x) = 0
- The number of bytes sent is always close to, but never above, 32K.
I saved the Wireshark files for both my Mac and Linux computers, in case anybody wants to look at them. They can be opened in Wireshark, Ethereal, and anything that understands .pcap files. The zip file is here:
- It doesn’t seem to be a network issue, since I can easily go over 100MB/s without any problem using other programs between the same two computers
- It doesn’t seem to be a VNC issue, since vnc4server on my Linux computer doesn’t do the same thing. (The Linux computer has higher resolution and the processor is a bit slower, too)
- It actually doesn’t seem to be an OSX problem either, as the built-in VNC server does not exhibit exactly the same problem. However, the built-in one does seem to only send 32 lines per framebuffer update, which appears to confuse my client (or something…)
Does anybody know what might be causing this, and more importantly, how to fix it?