Tuning tcp keepalive intervals for high performance
We are fine tuning sysctl network stack on Linux OS and change keepalive intervals for much better “response” times and load. These settings are lowered on our all managed performance servers that do host large sites – Drupal, Wordpress and custom LAMP services.
Enter the following lines in /etc/sysctl.conf
net.ipv4.tcp_keepalive_probes = 2
net.ipv4.tcp_keepalive_intvl = 30
And execute “sysctl -p” to set these settings in real-time.
By default it’s for Linux (Fedora, Redhat, Centos):
net.ipv4.tcp_keepalive_probes=9
net.ipv4.tcp_keepalive_intvl = 75
Enjoy!
Mark said,
January 28, 2009 at 3:00 pm
Nice tips folks! I will play around sysctl stack and let you know if I get any extra performance!
waerme said,
January 10, 2010 at 1:52 pm
Thanks for this article. We obtained the best performance with the following settings:
net.ipv4.tcp_keepalive_probes = 4
net.ipv4.tcp_keepalive_intvl = 20
In addition we set tcp_keepalive_time to 600
ASLIF said,
March 20, 2010 at 10:18 am
Hello, very much like your blog