I want to tune Windows 7 TCP stack for speed in a LAN environment.
Bit of background info: I've got a Citrix XenServer set up with Windows 2008R2, Windows 7 and Debian Lenny with Citrix kernel, Windows machines have Tools installed the iperf
server process is running on different host, also Debian Lenny. The servers are otherwise idle, tests were repeated few times to confirm results.
While testing with iperf
2008R2 can achieve around 600-700Mbps with no tuning what so ever but I can't find any guide or set of parameters that will make Windows 7 achieve anything over 150Mbps with no change in TCP window size using -w
parameter to iperf
.
I tried using netsh
autotuining
to disabled
, experimental
, normal
and highlyrestricted
- no change.
Changing congestionprovider
doesn't do anything, just as rss
and chimney
.
Setting all the available settings to same values as on Windows 2008R2 host doesn't help.
To summarize:
- Windows 2008R2 default settings: 600-700Mbps
- Debian, default settings: 600Mbps
- Windows 7 default settings: 120Mbps
- Windows 7 default,
iperf -w 65536
: 400-500Mbps
While the missing 400Mbps in performance I blame on crappy Realtek NIC in the XenServer host (I can do ~980Mbps from my laptop to the iperf server) it doesn't explain why Windows 7 can't achieve good performance without manually tuning window size at the application level.
So, how to tune Windows 7?
Try enable RSS and TCP Offload Engine:
It could be a different network driver in Windows 2008R2 vs Windows 7. Also, does xenserver always provide the same virtual nic to Windows 2008R2 and Windows 7? Because if it's different then a different driver will be loaded.
There may be some performance differences.
EDIT: I just remembered that windows 7 by default has very small send/receive buffers. In some app's I was developing I found that under windows 7 it was something pathetic like 8kB. Under ubuntu linux it's around 120kB. You may read somewhere that the limit is 64kB. This is actually incorrect for later versions of windows. I've found it can be set to even as high as 1MB and beyond. Although little performance increase will be noticed when it's this large.
This link provides some tcp tuning parameters in the registry that apply system wide. Be aware that many of those options can be overridden by applications themselves.
http://www.psc.edu/networking/projects/tcptune/ http://www.psc.edu/networking/projects/tcptune/OStune/winxp/winxp_stepbystep.html
Try increasing the window size and send/receive buffers. Hopefully those registry settings in the link still apply in windows 7.
MTU? http://networking.nitecruzr.net/2007/11/setting-mtu-in-windows-vista.html
TCP Autotuning (which you're already ruled out), MTU which has already been addressed and MMCS (Multimedia class scheduling) are usually the big differences. Since MMCS hasn't already been addressed, take a stab at disabling it.
Do ensure that your tcp window autoscaling is disabled if you're at or near LAN speed.
Instructions are available here: http://smallvoid.com/article/winnt-services-mmcss.html
You should not see Realtek driver inside of Windows as a virtual machine on Citrix XenServer. If you do, that means you do not have XenTools installed. The Realtek NIC you see, is an emulated one provided by QEMU service inside of Dom 0 (domain 0). After install of Windows OS, before you do anything else, especially application install, you need to install XenTools. Also, the speed is hardcoded after XenTools is installed (As noted in the VM User Guide), as there is no limit to speed on a virtual device.