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_intvl = 75



  1. Mark says:

    Nice tips folks! I will play around sysctl stack and let you know if I get any extra performance!

  2. waerme says:

    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

  3. ASLIF says:

    Hello, very much like your blog

Leave a Reply