ID: Q126716
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.
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.
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:
Sending larger data blocks will also result in more efficient use of the physical network because packets will typically be larger and less numerous. This option is much better than the first (enabling TCP_NODELAY) and should be used if at all possible.
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