Uncovering Hidden TCP Throttling in the Linux Kernel(cdn77.com)
389 points by josefinaspidlen 23 hours ago | 45 comments
tl;dr: CDN77 engineers tracked down random, hours-long TCP throughput collapses affecting only nginx on cache misses to an undocumented interaction with the cgroup memory controller: systemd placed nginx in its own cgroup, and Linux's `vmpressure()` throttles all sockets in a non-root cgroup for at least one second whenever reclaim efficiency drops below ~40% over a hardcoded 2MB scan window—regardless of how much free RAM the machine has. Their workaround was moving nginx to the root cgroup, and they upstreamed a patch (in Linux 6.19) adding a `sock_throttled` counter to `memory.events`, with a proper fix still to come.
HN Discussion:
  • ↑Appreciation for the detailed networking debugging write-up and its educational value
  • ↑Suggests alternative workaround via cgroup.memory=nosocket boot parameter
  • ↑Questions or critiques the kernel's memory pressure detection heuristic as flawed
  • ↑Broader criticism that cgroup memory controller has many traps beyond this issue
  • •Shifts focus to unrelated Linux networking gripes (delayed ACKs, dirty page ratio)