Some CDN77 downloads slowed for hours and recovered on their own. Daniel Sedlak found that it only happened when nginx missed its cache and had to fetch upstream. A curl fetch from the same server still ran at full speed.
- nginx was reading as fast as data arrived. Kernel tracing showed that TCP had capped the growth of its receive window, which limits how much data can be in flight.
- The host-wide TCP pressure counters read zero. The kernel also checked nginx’s control group, the Linux resource boundary for the service. A short run of unsuccessful attempts to free memory could flag the group’s sockets even with plenty of RAM free on the host.
- Linux 6.19 exposes
sock_throttledin the group’smemory.events. The new counter makes the slowdown visible; it doesn’t change what triggers it.
The Hacker News thread asks how to spot the slowdown sooner and what a workaround would cost.
What the thread adds
- dedalus — “We should have a target rate test on prod to ensure we always hit that and assert in logs when it goes slow”. An end-to-end probe would need to exercise the cache-miss path that actually slowed down.
- basilikum — “why is memory pressure even measured like this without considering the free memory at all?” eikenberry noticed that the TODO about scaling the scan window “remains there in spirit.” The upstream commit removed only the comment. The scan window stayed fixed, and the commit message calls for real-world data to support a change.
- rid — “I think the workaround for this at the moment is the boot parameter”
cgroup.memory=nosocket. The kernel documents it as disabling socket memory accounting across the host. CDN77 used a different workaround: it moved nginx into the root control group.
This is a selection, not a consensus. HN ranks comments without showing their scores, and the handles are pseudonymous.