Uncovering Hidden TCP Throttling in the Linux Kernel
josefinaspidlen
345 points
40 comments
November 30, 2026
Related Discussions
Found 5 related stories in 46.9ms across 4,908 title embeddings via pgvector HNSW
- TCP Use-After-Free: CVE-2026-98432 / CVSS 9.8 oger · 438 pts · October 31, 2026 · 52% similar
- NoisyTCP: Linux Kernel TCP Pre-Auth Remote Corruption (CVE-2026-99288) emilfihlman · 11 pts · November 15, 2026 · 51% similar
- CVE-2026-98432: Linux TCP Use-After-Free Risk and Patch Validation cobychapple · 38 pts · October 30, 2026 · 51% similar
- Linux 7.5 To Introduce An In-Kernel QUIC Implementation voxadam · 42 pts · December 01, 2026 · 50% similar
- Nginx 1.31.10 and 1.30.8 (fix CVE-2026-132779; TLS 1.3 early data) petecooper · 15 pts · November 23, 2026 · 48% similar
Discussion Highlights (13 comments)
freedomben
More of a meta comment, but I'm always grateful for these sort of network-related debugging blog posts. As a software eng who has a good grasp of networking at a conceptual layer, but has struggled to translate concept into concrete implementation in linux, I get a lot of value from these. Thank you to the author(s) for putting in the effort to write this up.
jeffbee
One of the wrongest default parameters in Linux is the dirty page ratio. By default, if I recall correctly, it permits up to 20% of pages to be dirty. If you're doing some quick arithmetic you already see the problem. The whole "pressure stall" concept has been adopted to hide this fact, when the better option is to simply lower the dirty page limit (not ratio) to 1GiB or less.
montjoy
Lots of little gems in this article. e.g. > We launch nginx as a systemd service, and systemd places each service into its own cgroup and sets default controllers Thank you for sharing.
dedalus
We should have a target rate test on prod to ensure we always hit that and assert in logs when it goes slow (in this case its memory throttle tomorrow is something else) as to ensure consistent performance for our apps
rid
I think the workaround for this at the moment is the boot parameter: cgroup.memory=nosocket If you're not bothered about socket memory counting towards the cgroup's limit (it's usually negligible).
basilikum
> Memory reclaim reports how many pages it scanned and how many it managed to free per cgroup. Once roughly two megabytes' worth of pages have been scanned, the kernel turns that into a ratio. If it freed less than about 40% of what it walked, that counts as memory pressure, and every socket in the cgroup gets throttled for that one second. What's NOT in the formula is how much free memory the machine has. Maybe I'm missing something, but can someone explain why memory pressure is detected like this in the first place? The article goes on to say that there was a TODO comment in the source to scale the scanning window proportional to the memory size, but why is memory pressure even measured like this without considering the free memory at all? Am I missing something or does that indeed make no sense?
kalak
> Disclaimer: No AI was used for writing this blog. Enjoy a humanly engineered piece. The disclaimer now belongs on articles that were human written?
tonymet
Do you need systemd or cgroups for this? Seems like unnecessary configuration and complexity. great effort debugging and isolating the root cause, but also an unnecessary issue.
eikenberry
> The two-megabyte window was a hardcoded constant in the kernel version we were debugging, with a TODO: in the kernel asking it to scale with the machine size. That TODO was removed about a month ago but remains there in spirit. https://github.com/torvalds/linux/commit/0041eef981cc55bb1f3...
InsidiousWombat
cgroup memory controller in general is full of traps. For example, it does also count filesystem caches into memory usage, which means just using it as limit against application leaks can get into bad behavior, especially if app relies on that cached file access, any leak will just cause that performance to get worse and worse far before it leaks to the level causing app to be killed. IIRC tmpfs is also charged to the cgroup that uses it. It makes sense from memory system perspective (else there would be a ways for cgroup to leak memory usage) but it also leads to many unintuitive debug sessions, and under-utilization of free RAM for caching
rstuart4133
Bravo to CDN77 for tracking this down. But limiting TCP socket memory use on a cgroup that could have TB of memory available to it and is not under memory pressure - WTF? The global kernel algorithm for socket memory still applies, so why have this extra socket limit on a cgroup when the user hasn't constrained the cgroup's memory? We regularly see posts from kernel devs sweating blood to squeeze an extra couple of % of performance under some rare circumstances, yet here we have a process being throttled by more than 80% for no good reason. This has got to be one of the most egregious kernel performance bugs I've seen in a long time. And it's been this way for 11 years.
imrehg
Oh, this was excellent! And such a "duh! everything falls into place" with the components that in the end contributed to it. And how many impactful TODO's must have be in the kernel? I've run a naive `rg "TODO:" --stats -c` on the current mainline (7.4-rc5), and looks like there's opportunity! 4501 matched lines 2548 files contained matches 97283 files searched (a bit more than 2.6% of files have at least one todo entry). Cutting it down, naively to only code withL `rg "TODO:" --stats -c -g "*.c"` 3731 matched lines 2093 files contained matches 37790 files searched More than double, 5.5% of `.c` files have some todo...
yamapikarya
any book resources where i can learn more about networking like tcp?