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.
More on Packages, kernel and boot
You must upgrade the kernel on 50 production servers and be able to roll back if the new kernel misbehaves. Plan it.AdvancedYou need to pin a package version so routine updates don't upgrade it (e.g. Docker or PostgreSQL). How?BeginnerA package update broke an application. How do you roll it back?IntermediateYour servers can't reach the internet but need packages. How do you provide repositories?IntermediateYou need to compile and install software from source on a server that also uses packages. How do you avoid making a mess?IntermediateYou need to change kernel boot parameters (e.g. add `transparent_hugepage=never`) persistently. How?Intermediate