Technical Q&ANW 26 - Numerous Small Packet Exchanges Result in Poor TCP Performance (Updated 25-May-98)Q My Open Transport TCP application exchanges a number of small packets of information, which may or may not generate a response from the other side. In some cases, I find that the application delays sending packets, and performance is terrible. How can I solve this problem? A One possible reason for this behavior is explained by the TCP_NODELAY option. As per the XTI
specification, under most circumstances TCP sends data as soon as it
is presented to TCP. However, when outstanding data has not yet been
acknowledged, TCP delays sending small amounts of data, gathering it
into a single packet which is sent when an acknowledgment is
received. This technique, known as the Nagle Algorithm,
is designed to prevent "send-side silly window syndrome." If an application
generates data one byte at a time, this algorithm prevents it from filling the
network with lots of one-byte
payload TCP packets.
For some applications, this packetization may cause significant
delays. Setting the err = SetFourByteOption(ep, INET_TCP, TCP_NODELAY, 1); This snippet relies on the the In general, disabling the Nagle Algorithm is a bad idea because it decreases the efficiency with which you use the network. A better solution is for you to structure your application so that it sends all logically associated data in one chunk. You may find OT's ability to send non-contiguous data helpful in this case. -- Rich Kubota -- Revised by Quinn "The Eskimo!" Worldwide Developer Technical Support Technical Q&A Previous Question | Contents | Next Question To contact us, please use the Contact Us page. |