Unofficial Hacker News companion — get notified on comment replies, and more.

Uncovering Hidden TCP Throttling in the Linux Kernel (opens external site)

402 points by josefinaspidlen 1 day ago | www.cdn77.com | 48 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (5)

  1. > 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?

    Replies (1)
    1. Afaiu memory pressure is a boolean. Either the cgroup is under pressure or not. What is the question?
      Replies (2)
      1. Further up they say (emphasis mine)

        > The memory controller helps you set limits for the maximum memory consumption of a service, which we are actually not using. It's the well-known memory.high, memory.max, etc. But the memory controller has an undocumented feature, which activates when the controller is only loaded.

        Why is there even memory pressure in the first place when the cgroup does not have a limit and there is lots of free memory?

        Replies (1)
        1. ok, this is more of cgroup question than tcp, not my area of expertise.
      2. This condition as described should not be considered memory pressure true.