[Fwd: Network performance on Mac and Linux]
andreas.raab at gmx.de
Mon Aug 29 19:24:33 UTC 2005
-------- Original Message --------
Subject: Network performance on Mac and Linux
Date: Mon, 29 Aug 2005 15:15:41 -0400
From: David P. Reed <dpreed at reed.com>
To: David A. Smith <davidasmith at bellsouth.net>, Andreas Raab
<Andreas.Raab at SqueakLand.org>
I'm sure you'd be as excited as I am to hear that I finally found the
last piece of the network performance issue I've been chasing on the Mac
Over the weekend, I built a Mac VM with the same Socket improvements
that I had done on Windows and Linux. It had the same
flaws as the Linux code (not surprisingly, since the SocketPlugin source
code is identical).
The pieces of the puzzle that were Mac/Unix specific were:
1) the rate of polling for I/O events was once per 200 milliseconds,
hard coded into checkForInterrupts part of the interpreter. (Windows
Socket I/O didn't depend on this since it uses high-priority threads to
wait for I/O).
I changed it to once per 1 millisecond. This reduced the delay from
well over 200 milliseconds to about 32 msec., averaged over a number of
2) The unix driver didn't set TCP_NODELAY as a socket option by default,
but Windows did. I changed the plugin to do this. This cut the measured
end-to-end delay on packets from 32 msec. to < 1 msec.
(Gaah - I had just assumed that this was done compatibly, and hadn't
checked for it).
So I will soon (tonight) have 3 VMs that have higher performance TCP
network code. They should support the VP2PPN layer cross-platform.
I'm wondering whether TCP_NODELAY should be default on or off for
Squeak. The default should be the same on ALL platforms, in any case,
and documented. For "real-time" stuff like Croquet and VoIP, TCP_NODELAY
should be on (as it was for Windows). For batch file transfer,
TCP_NODELAY should be off, because it helps by packing packets full of data.
More information about the Vm-dev