RHEL5.5 Socket Timeout Setting

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat RHEL5.5 Socket Timeout Setting
# 1  
Old 10-08-2010
RHEL5.5 Socket Timeout Setting

Is there a Linux tunable to reduce the amount of time a socket waits before considering the remote side dead?
Its the same senario when you try to telnet to a dead machine, telnet sits and waits for ~30seconds, before the socket timer expires and cancels the request.
# 2  
Old 10-08-2010
TCP has such obnoxiously long timeouts because it's designed with best-effort delivery in mind. You'll find tunables in /proc/sys/net/ipv4 but beware, the rest of the internet won't change with them so altering them may have consequences beyond your intentions. Try pinging the host before you connect to it.
# 3  
Old 10-08-2010
These are the 3 relevant tunables:

Quote:
tcp_keepalive_time

The interval between the last data packet sent (simple ACKs are not considered data) and the first keepalive probe; after the connection is marked to need keepalive, this counter is not used any further.

tcp_keepalive_intvl

The interval between subsequential keepalive probes, regardless of what the connection has exchanged in the meantime.

tcp_keepalive_probes

The number of unacknowledged probes to send before considering the connection dead and notifying the application layer.
# 4  
Old 10-08-2010
Those tunables are only active/applicable if the app uses SO_KEEPALIVE() in the program, correct? unfortunately, our original developers didnt seem to think it was a necessary evil.
# 5  
Old 10-10-2010
Quote:
Originally Posted by mrmurdock
Those tunables are only active/applicable if the app uses SO_KEEPALIVE() in the program, correct? unfortunately, our original developers didnt seem to think it was a necessary evil.
If it's just one application you're worried about, I've had great success with libkeepalive, which uses libc preload tricks to enforce keepalive options in new sockets by default. (do NOT have it preloaded globally. That way lies madness.) You'd be severely perverting its design intentions in making connections die faster though! Smilie

Last edited by Corona688; 10-10-2010 at 02:55 AM..
# 6  
Old 10-10-2010
Quote:
Those tunables are only active/applicable if the app uses SO_KEEPALIVE() in the program, correct?
Correct. As far as I recall, keepalive support is not the default behavior in GNU/Linux. Apps must request keepalive using the setsockopt interface.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Setting a Timeout

Hi I'm writing a script which based on a condition, restarts a set of servers. The problem I'm facing is, say if one of the server is down, my script stops there and fails to proceed. How can I ensure to set a timeout value on that script, so when the server is not reachable, the script should... (2 Replies)
Discussion started by: mathbalaji
2 Replies

2. IP Networking

Detect Socket timeout in tcpdump capture

Hello, I detect these errors in my logs : Socket timeout calling url http://server:port/bla/soap/selfcare/infoRapide] Unable to make proxyRequest I've made a tcpdump capture this way : tcpdump -i eth0 -s 0 -w /app/captura.pcap port 8080 But I'm fairly new in reading .pcap files with... (0 Replies)
Discussion started by: black_fender
0 Replies

3. Solaris

Session timeout setting in server

Hi All I need to set timeout of login session of a user if a user is idle for some time. I know the TMOUT setting but it work with only BASH & KORN shell only as I need to set for Bourne shell also. I am trying to put "ClientAliveInterval 300" in sshd_config & restart or refreshing the... (1 Reply)
Discussion started by: sb200
1 Replies

4. IP Networking

Clarification - Setting socket options at the same time when socket is listening

I need clarification on whether it is okay to set socket options on a listening socket simultaneously when it is being used in an accept() call? Following is the scenario:- -- Task 1 - is executing in a loop - polling a listen socket, lets call it 'fd', (whose file descriptor is global)... (2 Replies)
Discussion started by: jake24
2 Replies

5. UNIX for Advanced & Expert Users

mpssh - Setting timeout

Hi I am using mpssh client for parallel ssh connections. I need help in setting the timeout for the parallel sessions say 30 seconds overall. Plz Help. Thanks in advance M.S.Srivatsa (0 Replies)
Discussion started by: mssrivatsa
0 Replies

6. Shell Programming and Scripting

mpssh - Setting timeout

Hi I am using mpssh client for parallel ssh connections. I need help in setting the timeout for the parallel sessions say 30 seconds. Plz Help. Thanks in advance M.S.Srivatsa Double post, continued here (0 Replies)
Discussion started by: mssrivatsa
0 Replies

7. UNIX for Advanced & Expert Users

connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments

Hi, I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime. To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Discussion started by: chandrutiptur
0 Replies

8. AIX

how to change telnet timeout setting

Hi all Can any one solve my problem? I want to change the default timeout setting for telnet in aix, pls help me. (1 Reply)
Discussion started by: vjm
1 Replies

9. Solaris

Setting Screen Lock Timeout

Hello; I have Solaris 2.6 installed on many Sun AXI Ultra Sparc IIi systems. I want to set the Lock Screen global timeout for all users to 15 minutes. I read the Solaris CDE guide which instructed me to create a /etc/dt/config/C/sys.resources file and changed the timout to 15 minutes in... (1 Reply)
Discussion started by: rambo15
1 Replies

10. UNIX for Advanced & Expert Users

Setting Timeout for Xterm Sessions

Hi! Experts, Could someone tell me how to set a time out for xterm users.. I have set TMOUT which logs out telnet users after sometime.. The users here use exceed to connect to Xterm server. So, it doesnt kill xterm windows that have not been used even for 7 days.. Is there any work... (1 Reply)
Discussion started by: jyotipg
1 Replies
Login or Register to Ask a Question