tcp/ip keepalive

Posted on 2011-10-31
Last Modified: 2012-05-12
Can someone explain how tcp/ip keepalives work for an application and the os?
Do you know what the following values are
[test@testbox ipv4]$ cat tcp_retries1
[test@testbox ipv4]$ cat tcp_retries2
Are there any values worthwhile increasing to get around these tcp/ip timeouts?
What is the effect of increasing the default tcp_keepalive timeout from the default vallue of 7200?

Question by:lolaferrari
    LVL 31

    Assisted Solution

    Both of these are kernel parameters to set the following:
    The tcp_retries1 variable tells the kernel how many times it should retry to get to a host beforereaching a decision that something is wrong and that it should report the suspected problem tothe network layer.

    The tcp_retries2 value tells the kernel how many times to retry before killing an alive TCPconnection.
    LVL 61

    Accepted Solution


    Normally you should not touch keepalive parameters (connections are in CLOSE_WAIT for 2 days, and you should fix the other end unless that is IE from the internet). Retries are not keepalives. Parameters you mention will help on lossy links, namely having 50% loss on the wire.
    LVL 61

    Expert Comment

    There is some practical use for intense keepalives. (sysctl -a | grep keep) for more info on what to write into /etc/sysctl.conf  - they can trick broken firewall which drops (ftp) connection into thinking it is alive, but sometimes it is not enough.. But normally you would first try to fix that broke firewall.

    Featured Post

    Superior storage. Superior surveillance.

    WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

    Join & Write a Comment

    As a financial services provider, your business is impacted by two of the strictest federal regulations on record: the Sarbanes-Oxley Act and the Gramm-Leach-Bliley Act. Correctly implementing faxing into your organization to provide secure, real-ti…
    I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now