Optimising the Operating System Kernel
When installing an operating system, that system has settings that are so general that the OS can cater for a host of different scenarios. However, when you install a server to fulfill a certain task, you can tweak the OS kernel to optimise its behaviour to the piece of software installed on it.
Tweaking the different kernels are outside the scope of this guide, please see the appropriate parts of your operating system documentation. Here are some starting points:
OS | Starting Point |
---|---|
Linux |
To optimise the Linux kernel, you may edit the
The setting names can be found by browsing the
|
FreeBSD |
FreeBSD has also |
Sun Solaris |
Solaris uses |
Here is an example on how to tune the Linux kernel (tested on 2.6.24) for running the Apache web server and Varnish cache server. Albeit some of the settings may be redundant, this configuration is known to work and has a proven track record of serving several high traffic web sites:
net.core.rmem_max=16777216 net.core.wmem_max=16777216 net.ipv4.tcp_rmem=4096 87380 16777216 net.ipv4.tcp_wmem=4096 65536 16777216 net.ipv4.tcp_fin_timeout = 3 net.ipv4.tcp_tw_recycle = 0 net.core.netdev_max_backlog = 30000 net.ipv4.tcp_no_metrics_save=1 net.core.somaxconn = 262144 net.ipv4.tcp_syncookies = 0 net.ipv4.tcp_max_orphans = 262144 net.ipv4.tcp_max_syn_backlog = 262144 net.ipv4.tcp_synack_retries = 2 net.ipv4.tcp_syn_retries = 2