Windows 7 and Windows XP Network Performance Tweaks
If you want to get the most out of your Windows Box networking, then you will need access to the administrator account, or administrative privileges.Windows 7 and Windows Vista introduced new features to the TCP/IP stack, including CTCP, and TCP Window Auto-Tuning. The new implementation works much better by default than previous Windows versions with broadband internet connections, and is able to adjust many values on the automatically.
However there is room for improvement and you can adjust some values to better meet your use of your systsem
To enter some of the commands below, you will need to run "elevated" command prompt or "as administrator".
To do this.
1. Click Start
2. Run
3. type: cmd
4. Hit Enter
Check the TCP/IP state
To check the current status of the Vista TCP/IP tweakable parameters, in elevated command prompt type the following command:
netsh int tcp show global
The settings, as well as their default and recommended state are explained below. The two most important tweakable parameters are "Auto-Tuning Level" and "Congestion Control Provider".
Disable TCP Auto-Tuning
At the command prompt type:
netsh int tcp set global autotuninglevel=disabled
Enable Compound TCP
At the command prompt type:
netsh int tcp set global congestionprovider=ctcp
Enable ECN Capability
At the command prompt type:
netsh int tcp set global ecncapability=enabled
Enable Receive-side Scaling
At the command prompt type:
netsh int tcp set global rss=enabled
Enable TCP Chimney Offload
At the command prompty type:
netsh int tcp set global chimney=enabled
Setting
At the command prompt type:
netsh interface ipv4 show subinterfaceThis will display a list of interfaces, and their respective MTU values.Change the MTUvalue of a specific network card, at the command prompt type:
netsh interface ipv4 set subinterface "some network interface name" mtu=#### store=persistent
Example, the name of the network card you want to change iis "Wireless Network Connection" and you want to set its MTU to 1500, at the command prompt type:
netsh interface ipv4 set subinterface "Wireless Network Connection" mtu=1500 store=persistent
Registry Tweaks
Note that for changes to these settings to take effect the computer needs to be rebooted.Moderate understanding of the Windows Registry is needed. You are responsible for your own actions. See
Evilware.com Terms of Use
1. Go to Start
2. Run
3. type: regedit
4. Press Enter
While logged in as administrator), you can navigate and edit the following keys.MTU (Maximum Transmission Unit) - the maximum packet size.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{...}\
MTU=1500 (DWORD, entry does not exist by default)
The {....} part of the above path is the unique identifier of your network adapter. You can recognize the correct adapter by looking at it's IP address, if obtaining IP automatically labeled by: DhcpIPAddress=192.168.x.x text value, for example.
Leave this at default, Vista and Windows 7 use the largest possible packet size for the underlying network by default.
TCP 1323 Options
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Tcp1323Opts=1 (DWORD, entry created automatically by Windows when you run the "netsh int tcp set global autotuninglvl=..." command, set to 0 by default).
Setting this seems to have no effect, since auto-tuning uses the TCP 1323 scale factor and changes it on the fly, disregarding this setting. Additional testing may be required to determine it's effect if auto-tuning is turned off. Setting it to 1 is best for broadband connections.
NetDMA
NetDMA enables support for advanced direct memory access. In essence, it provides the ability to more efficiently move network data by minimizing CPU usage. NetDMA frees the CPU from handling memory data transfers between network card data buffers and application buffers by using a DMA engine.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
EnableTCPA=1 (DWORD, 1 to enable, 0 to disable NetDMA. Value not present by default in Vista)
Recommended setting is 1, a new DWORD value may need to be created if not already present in the registry.
DefaultTTL
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
DefaultTTL=64 (DWORD, set to a decimal value between 32 and 128. Recommended: 64)
TcpMaxDataRetransmissions
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ParametersTCPMaxDataRetransmissions=7 (DWORD, recommended: between 3 and 10, default registry value 255, default 5 in documentation)
SynAttackProtect
This setting provides protection against SYN denial of service (DoS) attacks. When enabled, connections timeout sooner if SYN attack is detected. When set at 1,
TCPMaxDataRetransmissions can be lowered further.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameter\SynAttackProtect=1 (DWORD, recommended: 1, not present in registry by default)
Set DNS and Hosts Priority
Setting can improve DNS and host name resolution by increasing the priority of of related services, while keeping their order. Lower numbers mean higher process priority. The corresponding registry settings are as follows:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ServiceProvider
LocalPriority=4 (DWORD, recommended: 4, default: 499) - local names cache
HostsPriority=5 (DWORD, recommended: 5, default: 500) - the HOSTS file
DnsPriority=6 (DWORD, recommended: 6, default: 2000) - DNS
NetbtPriority=7 (DWORD, recommended: 7, default: 2001) - NetBT name resolution, including
WINS
TcpTimedWaitDelay (port allocation)
Windows 7 and Vista have improved from previous Windows versions, and are usually sufficient under normal load. In some instances under heavy load it it may be necessary to adjust the settings to tweak the availability of user ports requested by an application.
This is often the case with online games such as World of Warcraft.
The following registry values need to be edited:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
MaxUserPort=65535(DWORD, not in the registry by default. Recommended: leave at default, or use a number above 16384 up to 65535 decimal as necessary) - maximum number of ports to use. 1024 is
automatically subtracted from entered value to allow for reserved ports under 1024.
TcpTimedWaitDelay=30
(DWORD, 0xffffffff in registry by default. Recommended: 30 decimal, denoting 30 seconds) - time to wait before reclaiming ports, in seconds. Default time before reclaiming ports, if value is at 0xffffffff or not present in the registry is 120 seconds. Just reducing the delay is often sufficient without changing MaxUserPort, as it allows for reusing ports more efficiently.
Ephemeral ports can be checked and changed using netsh as well.
To list the current values, in command prompt, type:
netsh int ipv4 show dynamicportrange tcp
To set both the starting, and max user port using netsh, in elevated command prompt type:
netsh int ipv4 set dynamicportrange protocol=tcp start=1025 num=64511 (start=NNN denoting the starting port, and num=NNN denoting the number of ports)
QoS Reserved Bandwidth
As with Windows XP, nework adapters have a "QoS Packet Scheduler" enabled by default, which reserves 20% of bandwidth by default for QoS enabled applications that request priority traffic.
Change this value to
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PschedNonBestEffortLimit=0
Gaming Tweak - Disable Nagle's algorithm - Gaming Tweak
The tweak below allows for tweaking or disabling Nagle's alogrithm. Disabling nagle allows for small packets to be transferred immediately without delay. Note that disabling Nagle's algorithm is only recommended for some games, and it may have negative impact on file transfers such as Bit Torrent.
To implement this tweak, in the registry editor find:
This setting configures the maximum number of outstanding ACKs in Windows
XP/2003/Vista/2008:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{NIC-id}
There will be multiple NIC interfaces listed there, for example: {1660430C-B14A-4AC2-8F83
-B653E83E8297}. Find the correct one with your IP address listed. Under this {NIC-id} key, create a new DWORD value:
TcpAckFrequency=1 (DWORD value, 1=disable, 2=default, 2-n=send ACKs if outstanding ACKs before timed interval. Setting not present by default).
For gaming performance, recommended is 1 (disable). For pure throughput and data streaming, you can experiment with values over 2.
Also, find the following key (if present):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters
Add a new DWORD value:
TCPNoDelay=1 (DWORD value, 0 to enable Nagle's algorithm, 1 to disable, not present by default)
Configure the ACK interval timeout (only has effect if nagling is enabled), find the
following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{NIC-id}
TcpDelAckTicks=0 (DWORD value, default=2, 0=disable nagling, 1-6=100-600 ms). Note you can also set this to 1 to reduce the nagle effect from the default of 200ms without disabling it.
Notes:
disabling nagle's algorithm can reduce World of Warcraft latency by nearly half in most cases
Windows XP/Windows 2003 needs hotfix or SP2 for it to work MS KB 815230
0 comments:
Post a Comment