PRB: Poor TCP/IP Performance When Doing Small Sends

ID: Q126716

The information in this article applies to:

SYMPTOMS

When doing multiple sends of less than the Maximum Transmission Unit (MTU), you may see poor performance. On an Ethernet network, the MTU for TCP/IP is 1460 bytes.

CAUSE

When an application does two sends of less than a transport MTU, the second send is delayed until an ACK is received from the remote host. The delay occurs in case the application does another small send. TCP can then coalesce the two small sends into one larger packet. This concept of collecting small sends into larger packets is called Nagling.

RESOLUTION

There are a number of ways to avoid Nagling in an application. Here are two. The second is more complex but gives a better performance benefit:

On Windows NT 3.51, if you are sending files, you should use the new TransmitFile() API. This call reads the file data directly from the file system cache and sends it out over the wire. The TransmitFile() call can also take a data block that will be sent ahead of the file, if desired.

REFERENCES

More information about Nagling and the Nagle algorithm can be found in RFC 1122.

Additional query words:

Keywords          : kbnetwork kbAPI kbNTOS310 kbNTOS350 kbNTOS351 kbSDKPlatform kbWinOS95 kbWinsock kbGrpNet 
Issue type        : kbprb

Last Reviewed: July 31, 1998