TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Linux network performance parameters

458 pointsby dreampeppers99over 1 year ago

9 comments

klabb3over 1 year ago
A random thing I ran into with the defaults (Ubuntu Linux):<p>- net.ipv4.tcp_rmem ~ 6MB<p>- net.core.rmem_max ~ 1MB<p>So.. the tcp_rmem value overrides by default, meaning that the TCP receive window for a vanilla TCP socket actually goes up to 6MB if needed (in reality - 3MB because of the halving, but let&#x27;s ignore that for now since it&#x27;s a constant).<p>But if I &quot;setsockopt SO_RCVBUF&quot; in a user-space application, I&#x27;m actually capped at a maximum 1MB, even though I already have 6MB. If I try to <i>reduce it</i> from 6MB to e.g. 4MB, it will result in 1MB. This seems very strange. (Perhaps I&#x27;m holding it wrong?)<p>(Same applies to SO_SNDBUF&#x2F;wmem...)<p>To me, it seems like Linux is confused about the precedence order of these options. Why not have core.rmem_max be larger and the authoritative directive? Is there some historical reason for this?
评论 #37412582 未加载
评论 #37409053 未加载
gjulianmover 1 year ago
This is great, not just the parameters themselves but all the steps that a packet follows from the point it enters the NIC until it gets to userspace.<p>Just one thing to add regarding network performance: if you&#x27;re working in a system with multiple CPUs (which is usually the case in big servers), check NUMA allocation. Sometimes the network card will be in one CPU while the application is executing on a different one, and that can affect performance too.
评论 #37411835 未加载
napkinover 1 year ago
Just changing Linux&#x27;s default congestion control (net.ipv4.tcp_congestion_control) to &#x27;bbr&#x27; can make a _huge_ difference in some scenarios, I guess over distances with sporadic packet loss and jitter, and encapsulation.<p>Over the last year, I was troubleshooting issues with the following connection flow:<p>client host &lt;-- HTTP --&gt; reverse proxy host &lt;-- HTTP over Wireguard --&gt; service host<p>On average, I could not get better than 20% theoretical max throughput. Also, connections tended to slow to a crawl over time. I had hacky solutions like forcing connections to close frequently. Finally switching congestion control to &#x27;bbr&#x27; gives close to theoretical max throughput and reliable connections.<p>I don&#x27;t really understand enough about TCP to understand why it works. The change needed to be made on both sides of Wireguard.
评论 #37409187 未加载
评论 #37411779 未加载
评论 #37429223 未加载
doctorpanglossover 1 year ago
Does performance tuning for Wi-Fi adapters matter?<p>On desktops, other than disabling features, can anything fix the problems with i210 and i225 ethernet? Those seem to be the two most common NICs nowadays.<p>I don&#x27;t really understand why common networking hardware and drivers are so flawed. There is a lot of attention paid to RISC-V. How about start with a fully open and correct NIC? They&#x27;ll shove it in there if it&#x27;s cheaper than an i210. Or maybe that&#x27;s impossible.
评论 #37408967 未加载
评论 #37406984 未加载
评论 #37411812 未加载
teleforceover 1 year ago
Great overview of the Linux network queues as provided in the Figure, should paste it on the wall somewhere.<p>Brendan&#x27;s System Performance books provide nice coverage on Linux network performance and more [1]. It&#x27;s already in the second edition, both are excellent books but the 2nd edition focuses mainly on Linux whereas the 1st edition also include Solaris.<p>There&#x27;s also a more recent book on BPF Performance Tools by him [2].<p>[1] Systems Performance: Enterprise and the Cloud, 2nd Edition (2020)<p><a href="https:&#x2F;&#x2F;www.brendangregg.com&#x2F;systems-performance-2nd-edition-book.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.brendangregg.com&#x2F;systems-performance-2nd-edition...</a><p>[2] BPF Performance Tools:<p><a href="https:&#x2F;&#x2F;www.brendangregg.com&#x2F;bpf-performance-tools-book.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.brendangregg.com&#x2F;bpf-performance-tools-book.html</a>
zartstromover 1 year ago
I enjoyed skimming through the article. Very well researched and presented.<p>But can anybody help me out, who tunes linux network parameters on a regular basis?
raggiover 1 year ago
This doc kinda needs to say &quot;TCP&quot; somewhere, as it&#x27;s very focused on TCP concerns - which is useful, people are mostly using TCP. The default UDP tunings are awfully low and as such are notably missing.
评论 #37414882 未加载
freedombenover 1 year ago
Could anyone recommend a video or video series covering similar material?<p>There lots on networking in general, but I&#x27;ve had a hard time finding some on Linux specific implementation
评论 #37406239 未加载
评论 #37405752 未加载
cryptonectorover 1 year ago
Nothing about PMTUD?
评论 #37425518 未加载
评论 #37413613 未加载