How can I improve performance on Windows under a heavy load?

When running a subscribing application on a Windows system under heavy load (such as when running performance tests), you may experience erratic behavior when receiving samples, due to reassembly failures. You may see that the application temporarily stops receiving data. 

You can verify this problem by running netstat from a command prompt on the Windows machine of the subscribing application:

netstat -s -p ip 1

You may see something similar to:

IPv4 Statistics

Packets Received = 283969
Received Header Errors = 0
Received Address Errors = 115414
Datagrams Forwarded = 0
Unknown Protocols Received = 0
Received Packets Discarded = 105
Received Packets Delivered = 124061
Output Requests = 22113
Routing Discards = 0
Discarded Output Packets = 0
Output Packet No Route = 0
Reassembly Required = 281230
Reassembly Successful = 121445
Reassembly Failures = 102348
Datagrams Successfully Fragmented = 146
Datagrams Failing Fragmentation = 0
Fragments Created = 292

IPv4 Statistics

Packets Received = 283970
Received Header Errors = 0
Received Address Errors = 115414
Datagrams Forwarded = 0
Unknown Protocols Received = 0
Received Packets Discarded = 105
Received Packets Delivered = 124062
Output Requests = 22117
Routing Discards = 0
Discarded Output Packets = 0
Output Packet No Route = 0
Reassembly Required = 281230
Reassembly Successful = 121445
Reassembly Failures = 104124
Datagrams Successfully Fragmented = 146
Datagrams Failing Fragmentation = 0
Fragments Created = 292

Look at value reported for this line:

Reassembly Failures =

If this value is rapidly increasing, you probably need to increase the MaximumReassemblyHeaders. The default MaximumReassemblyHeaders value on Windows is 100. A higher value will fix the reassembly failures and the erratic behavior of the subscribing application.

To increase the maximum reassembly headers:

  1. Use regedit to navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
  2. Select Edit, New, DWORD (32-bit) Value to create a value named MaximumReassemblyHeaders. Set it to 0xffff (the maximum allowed value). 
  3. Reboot your machine for the value to take effect.

Note: Running Wireshark on the receiving machine may give you the impression that all fragments were properly received and made it into the socket buffer. This is actually not the case.

Platform:
Keywords:

Comments

Removed broken link to Microsoft.