Kernel Parameter Tuning for Production
Fix connection drops under load by tuning kernel networking parameters.
A advanced Linux challenge worth 20 points. Solve it hands-on in a real Linux environment in your browser - no local setup, no fake shells.
The Challenge
An API at 10k req/s is dropping connections. ss -s shows thousands in SYN_RECV — the accept queue is overflowing because somaxconn is at default (128).
Your tasks:
- Check current: sysctl net.core.somaxconn
- Apply live: sysctl -w net.core.somaxconn=65535 (or write directly to /proc/sys/)
- Apply live: sysctl -w net.ipv4.tcp_max_syn_backlog=65535
- Apply live: sysctl -w net.ipv4.tcp_tw_reuse=1
- Apply live: sysctl -w vm.swappiness=10
- Persist all four to /etc/sysctl.d/99-prod.conf
- Verify: sysctl -p /etc/sysctl.d/99-prod.conf
- Run check to validate