Uncovering Hidden TCP Throttling in the Linux Kernel
The surprising clue was a receive-side TCP threshold that had become tiny: rcv ssthresh was exactly four times the advertised maximum segment size. In this incident, TCP throttling means the kernel’s receive-window behavior was associated with nginx receiving data too slowly on certain connections. It was not a general slowdown across every process or connection on the server. The team found that curl could download the same content at a normal speed while nginx was slow. The issue appeared on HTTP cache misses, when nginx had to fetch content, and it affected nginx processes. Rebooting restored normal operation for a while, but the problem could return later. The team traced the small threshold to a path through tcp grow window that was possible when tcp under memory pressure() returned true. This made kernel behavior a stronger lead than the configuration or userspace explanations they had tested. The article excerpt does not show the full mechanism or a final fix, so it does not establish every step between memory pressure and slow downloads. It does show why observing TCP socket fields revealed a clue that ordinary system checks had missed.
What does TCP throttling mean in this incident?
The surprising clue was a receive-side TCP threshold that had become tiny: rcv_ssthresh was exactly four times the advertised maximum segment size. In this incident, TCP throttling means the kernel’s receive-window behavior was associated with nginx receiving data too slowly on certain connections. It was not a general slowdown across every process or connection on the server.
The team found that curl could download the same content at a normal speed while nginx was slow. The issue appeared on HTTP cache misses, when nginx had to fetch content, and it affected nginx processes. Rebooting restored normal operation for a while, but the problem could return later. The team traced the small threshold to a path through tcp_grow_window that was possible when tcp_under_memory_pressure() returned true.
This made kernel behavior a stronger lead than the configuration or userspace explanations they had tested. The article excerpt does not show the full mechanism or a final fix, so it does not establish every step between memory pressure and slow downloads. It does show why observing TCP socket fields revealed a clue that ordinary system checks had missed.
Which downloads slowed down, and which connections were unaffected?
The striking distinction was not simply between fast and slow networks: curl worked while nginx was throttled. The slowdown appeared on HTTP cache misses, when nginx had to fetch content instead of serving it from the edge node’s cache. The article describes the problem as affecting certain connections, not every client connected to the server.
The team ran curl on a server while the issue was actively happening and got a normal download speed. By contrast, nginx downloaded slowly on cache-miss connections. The trouble also appeared in multiple regions, while neighboring servers had the same settings and versions but were healthy. Those observations made a single ISP or network path less likely as an explanation.
The article does not say that every cache hit, every non-nginx process, or every client was tested and proved unaffected. It does report that the observed issue affected nginx processes and appeared on cache misses. That distinction guided the investigation toward nginx’s fetching behavior and the TCP kernel path, rather than treating all traffic through the server as equally impaired.
How small did the TCP receive slow-start threshold become compared with the advertised maximum segment size?
The surprising measurement was a direct ratio: the TCP receive slow-start threshold, rcv_ssthresh, was exactly four times the advertised maximum segment size, or MSS. The article characterizes the resulting threshold as tiny. It does not give a byte count for the MSS or for rcv_ssthresh, so the supported answer is the ratio rather than a specific number of bytes.
The team found the pattern while probing tcp_rcv_established and printing selected fields from struct tcp_sock. They examined several possible indicators, including the advertised MSS, the sending congestion window, and the receive window. The small rcv_ssthresh stood out because the article says tcp_adjust_rcv_ssthresh() was the only function that wrote that value.
The investigation then narrowed the viable path to tcp_grow_window(), reached only when tcp_under_memory_pressure() returned true. The supplied excerpt does not include the remainder of the code or report a final repair. Still, the four-MSS measurement mattered: it gave the team a concrete kernel-level clue after configuration checks and syscall tracing had shown no anomalies.
Why did the problem appear on cache misses in a multi-layer CDN?
The important distinction was whether the requested content was already cached at the edge. A cache hit could be served by the closest edge node, while a miss required that node to fetch the content from an upper layer. In this multi-layer CDN, the request could travel through more layers until a shield node fetched it from the customer’s origin.
All CDN77 layers ran heavily modified nginx. The team observed slow downloads on HTTP cache misses, where nginx was fetching content, but a curl download on the affected server worked normally. That pattern connected the symptom to nginx’s upstream fetching path rather than to every transfer through the server. The article does not claim that the cache-miss architecture itself caused the bug.
This context mattered because it helped narrow the investigation: the team focused on nginx processes and the TCP behavior involved in those connections. They had already found that the issue occurred across multiple regions and that nearby servers shared the same configurations and software versions. The cache-miss clue therefore helped distinguish where the symptom appeared, even though it did not by itself explain why.
What kernel condition caused the receive threshold to be adjusted downward?
The key condition was TCP memory pressure. The team found that the only viable path they could identify to tcp_adjust_rcv_ssthresh() ran through tcp_grow_window(), and that path was reached only when tcp_under_memory_pressure() returned true. This connected the unusually small receive threshold to a kernel pressure check.
The article’s code excerpt begins with a condition that checks whether the socket is not under memory pressure. It then shows a normal window-growth calculation in that branch. The supplied text cuts off before the rest of the code, so it does not show exactly how the other branch adjusts the threshold or what triggered the pressure result in this incident.
That limitation matters: the pressure check is the condition the investigation identified, not a complete explanation of the kernel’s internal behavior. The finding still gave the team a specific direction after its checks of sysctl settings, nginx configuration, CPU, memory, logs, and syscall timing had revealed no discrepancy. The excerpt does not state a final fix or resolution.
Why could the kernel report TCP memory pressure even while the global pressure counters showed zero?
The source excerpt identifies tcp_under_memory_pressure() as important, but it does not mention global pressure counters, memory cgroups, or explain how a pressure result could coexist with zero global counters. So it does not establish the exact reason for the situation posed in this question.
As general Linux context, pressure checks can depend on the kernel version and configuration. In configurations that account for socket memory pressure by memory cgroup, a particular cgroup’s pressure state may differ from a global counter. Therefore, seeing a zero global value would not necessarily rule out every possible pressure signal used by a kernel’s socket code. This is context, not a confirmed account of the incident.
To identify the cause in a real system, an investigator would need to check the relevant kernel implementation and configuration, and inspect the pressure signals it actually consults. The article excerpt does not provide those details or say that memory cgroups were involved. It only reports that the relevant check returned true on the path the team considered viable.
How do TCP's receive window and congestion window differ in limiting how much data can be sent?
The receive window and congestion window are different limits on a TCP transfer. The receive window is advertised by the receiver and communicates how much more data it can accept. Its purpose is to avoid sending more data than the receiver can handle. In the article, the receive window was the team’s main suspect during the investigation.
The congestion window is maintained by the sender and reflects how much data it is willing to have in flight under its congestion-control behavior. It is about the network path, rather than the receiver’s available capacity. The article lists snd_cwnd, the sending congestion window, among the TCP fields the team inspected, alongside receive-side fields such as rcv_wnd and rcv_ssthresh.
As general TCP context, the amount of unacknowledged data in flight is constrained by both limits; the tighter one can restrict sending. This distinction helped frame the investigation: a sending congestion-window problem and a receive-window problem are not interchangeable explanations. The article reports that the receive window was the main suspect, then highlights the unusually small rcv_ssthresh as a kernel clue.
This brief was written by AI from the original reporting and checked by other models. Names, figures and quotes come from the source; read it for full context.
Read more in the JupiteX app
Pulse is free. New stories every 4 hours, each one broken into the questions that explain it.
Or read more news on the web