Interview Prep/Linux/Logs, Limits & High-Traffic Tuning

What does `net.core.somaxconn` control?

IntermediateProductionLogs, Limits & High-Traffic Tuning
Answer

The maximum length of a listening socket's accept queue (fully established connections waiting for the app to accept()). The app's listen(backlog) is capped at this value. Default is 4096 on kernels 5.4+ (128 before). When it overflows, the kernel drops connections; nstat -az TcpExtListenOverflows and ss -lnt (Recv-Q vs Send-Q on LISTEN sockets) show it. Raise both the sysctl and the app's backlog (nginx listen 443 backlog=8192).

All Linux questions Roadmap: Linux

More on Logs, Limits & High-Traffic Tuning