Linux for Developers
/Advanced
Kernel Tuning (sysctl)
Definition
The process of modifying Linux kernel parameters at runtime using the `sysctl` command or `/etc/sysctl.conf` to optimize performance, networking, and security.
Explain Like I'm New
Tuning the engine of your car while you are driving it down the highway. You can adjust how the OS handles memory, network packets, and file limits without rebooting.
Real World Example
A high-traffic web server keeps dropping connections. The admin types `sysctl -w net.core.somaxconn=1024`. This instantly tells the kernel to increase the maximum number of allowed queued network connections from 128 to 1024, fixing the site.
Common Use Cases
- •High-performance database tuning
- •Network optimization for web servers
Interview Questions
basic
- If you use the `sysctl` command to change a kernel parameter, does the change survive a server reboot?
intermediate
- What is 'swappiness' (`vm.swappiness`) and why do database admins usually change it?