Basic Kernel Tuning with sysctl
`sysctl` is an interface for examining and changing kernel parameters at runtime. You can make temporary changes or make them permanent by editing `/etc/sysctl.conf`.
Example: Tuning Network Parameters
A common use case is to tune TCP settings for better performance on high-latency networks.
To make changes permanent, edit `/etc/sysctl.conf` and add parameters like:
# Increase the max number of open files
fs.file-max = 100000
# Increase TCP max buffer size
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
# Increase TCP buffer sizes
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
CopyTo apply the changes without rebooting, run:
sudo sysctl -p
CopyWarning: Do not change kernel parameters unless you understand their effect, as it can cause instability.