Interview Prep/Networking/Performance, Cost & Scale

How do you tune Linux network settings for a high-traffic server?

IntermediateProductionPerformance, Cost & Scale
Answer

Raise net.core.somaxconn and net.ipv4.tcp_max_syn_backlog, widen ip_local_port_range, increase fs.file-max and ulimit -n, set net.core.rmem_max/wmem_max and tcp_rmem/tcp_wmem for high BDP links, enable tcp_tw_reuse for outbound-heavy clients, and use BBR where appropriate.

sysctl -w net.core.somaxconn=4096 net.ipv4.tcp_max_syn_backlog=8192
sysctl -w net.ipv4.ip_local_port_range="10240 65000"

Change one thing at a time and measure; copy-pasted sysctl lists often hurt.

All Networking questions Roadmap: Networking for DevOps

More on Performance, Cost & Scale