Nagle's algorithm: Difference between revisions

Content deleted Content added
m References: Fix cite book maintenance issue
Johnh (talk | contribs)
Line 43:
 
==Negative effect on larger writes==
The Nagle algorithm applies to data writes of any size. If the data in a single write spans 2''n'' packets, where there are 2''n''-1 full-sized TCP segments followed by a partial TCP segment, the original Nagle algorithm would withhold the last packet, waiting for either more data to send (to fill the packet), or the ACK for the previous packet (indicating that all the previous packets have left the network).<ref>{{cite journal|last = Heidemann | first = John | title = Performance Interactions Between P-HTTP and TCP Implementations|journal = Computer Communications Review|volume = 27|issue = 2|pages = 65-73|publisher = ACM|date = April 1997|doi = 10.1145/263876.263886}}</ref><ref>{{cite web|url=http://www.stuartcheshire.org/papers/NagleDelayedAck/ |title=TCP Performance problems caused by interaction between Nagle's Algorithm and Delayed ACK |publisher=Stuartcheshire.org |date= |accessdate=November 14, 2012}}</ref>
 
In any non-pipelined stop-and-wait request-response application protocol where request data can be larger than a packet, this can artificially impose a few hundred milliseconds latency between the requester and the responder. Originally this was not felt to be a problem, since any non-pipelined stop-and-wait protocol is probably not designed to achieve high performance in the first place, so a few hundred milliseconds extra delay should make little difference. A later refinement to Nagle’s algorithm, called Minshall’s Modification,<ref>{{cite IETF|title=A Proposed Modification to Nagle’s Algorithm|draft=draft-minshall-nagle}}</ref> solved this problem with stop-and-wait protocols that send one short message and then wait for an acknowledgement before sending the next, removing the incentive for them to disable Nagle’s algorithm (though such protocols will still be limited by their design to one message exchange per network round-trip time).