|By Gary Kaiser||
|July 28, 2014 07:00 AM EDT||
In Part V, we discussed processing delays caused by "slow" client and server nodes. In Part VI, we'll discuss the Nagle algorithm, a behavior that can have a devastating impact on performance and, in many ways, appear to be a processing delay.
Common TCP ACK Timing
Beyond being important for (reasonably) accurate packet flow diagrams, understanding "normal" TCP ACK timing can help in the effective diagnosis of certain types of performance problems. These include those introduced by the Nagle algorithm, which we will discuss here, and application windowing, to be discussed in Part VII.
A slightly simplified but useful rule of thumb is as follows:
A receiving node will:
- Acknowledge every second packet immediately
- Acknowledge a single packet if the Delayed ACK timer expires before a second packet arrives
The Delayed ACK timer typically defaults to 200 milliseconds, at least on Microsoft platforms.
While this behavior is quite common, you may encounter differences; for example, changing the ACK frequency to every packet is an approach to circumventing certain problems, while shorter Delayed ACK timers may be observed in non-Microsoft environments.
ACK every second packet, or a single packet after the Delayed ACK timer expires
The Nagle Algorithm
The Nagle algorithm was designed to help reduce network overhead by delaying the transmission of a small packet (i.e., <MSS) until all previously transmitted packets have been acknowledged. The goal was to prevent a node from transmitting many small packets if the application delivers data to the socket rather slowly. The usefulness of the algorithm and the frequency with which it is applied have both diminished dramatically; however, you may still encounter it, as the option still exists in most environments.
To begin to understand the impact of the Nagle algorithm, consider a request or reply flow; chances are, the size of the payload in the flow is not an exact multiple of the MSS. Therefore, the last packet of the flow will be smaller than the MSS. With Nagle enabled, this last packet will not be transmitted until the previous (penultimate) packet has been acknowledged. In the best case, the penultimate packet represents an even-numbered packet in the flow, triggering an immediate acknowledgement from the receiver which in turn "releases" the final small packet. In this case, the Nagle penalty is equal to one network round-trip for the entire flow. Should the penultimate packet be an odd-numbered packet, it will not be acknowledged by the receiver until the Delayed ACK timer expires; the penalty becomes one network round-trip plus approximately 200 milliseconds.
The HTTP reply includes two data packets; the last packet is not sent until the earlier packet has been acknowledged. The Delayed ACK timer adds about 200 milliseconds to the transmission of the reply.
For more network tips click here for the full article
- Understanding Application Performance on the Network | Part 1
- Understanding Application Performance on the Network | Part 3
- Understanding Application Performance on the Network | Part 2
- Understanding Application Performance on the Network | Part 5
- Understanding Application Performance on the Network | Part 4
- Understanding APM on the Network
- Understanding Application Performance on the Network | Part 6
- Can Wire Data Be #APM? | @DevOpsSummit #DevOps #AI #ML #Monitoring
- IT Operations and Digital Disruption | @DevOps Summit #APM #DevOps
- Application Performance Analytics | @DevOpsSummit @Dynatrace #DevOps #APM