Interview Prep/Linux/Packages, kernel and boot

You need to tune kernel parameters for a high-traffic web server. Which ones and why?

AdvancedScenarioPackages, kernel and boot
Answer

Situation read → Connection backlog, file handles and buffers.

What I'd do → /etc/sysctl.d/70-web.conf:

net.core.somaxconn = 4096
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.ip_local_port_range = 10240 65535
net.ipv4.tcp_fin_timeout = 15
net.core.netdev_max_backlog = 16384
fs.file-max = 2097152
net.ipv4.tcp_congestion_control = bbr

Plus LimitNOFILE= in the service unit and the app's own listen backlog. Apply with sysctl --system and measure before and after.

Why → Defaults suit general workloads; bursts overflow small backlogs and drop SYNs.

Interview tip → Say "measure first" (nstat, ss -s, listen queue overflows in netstat -s), never copy-paste tuning blindly.

All Linux questions Roadmap: Linux

More on Packages, kernel and boot