Re: Regarding Keep-Alive doubt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<quote sender="Vishal">
>    We have a tcp keepalive options in the kernel, like when i do "cat /proc/sys/
> 
>    net.ipv4.tcp_keepalive_time"   = 7200 (sec)
>    net.ipv4.tcp.keepalive_probes" = 9 

The keepalive_time is a system-wide parameter. Whatever you do, it will
affect other applications in the same box. The Host Requirements RFC
says that the default keepalive_time must not be lesser than two hours.

>    As far as i belived that we use keep Alive at application level (HTTP).  i.e if client request the connection to be kept alive,
>    this is implemented in the server and then accordinging we close the socket.
>    But this says that before assuming the connection is dead, kernel probes 9 times in the duration of 2 hours and then if 
>    there is no response, kernel closes the socket.

Are we talking about HTTP? HTTP is stateless. Why would the client
request the connection to be kept alive? If it is an userspace program
at the Application level, then it may want to implement its own
keepalive mechanism, and this is independent of the TCP keepalive
feature.

>    Now , i  reduce tcp_keepalive_time to 5 minutes and tcp_keepalive_probes to 2
>    (using sysctl) and put sleep of 10 minutes in client,  the connected server-client socket (on the server side) 
>    shud be closed in 5 minutes, Right !!, as i have set the value(of 5 minutes) and there is no data written or read on
>    the connected socket (in the 5 minutes interval, v.i.z.,client is sleeping).
> 
>    And the client shud be sent "RST" ----- connection reset by host, on trying to write data 
>    on the connected fd (descriptor).
> 
>    This does not happen. the kernel does not close the socket and the connection is maintained, It serves the next 
>    request on the same  connection.

Did your client cater for "Connection Reset" in the first place?

>    Correct implementation: 11 minutes, 75 second intervals, 9 packets]

hmmmmmmmmmm

Eugene

> 
>    **************************************************************************
> 
>    If any one could clear this confusion to me , it wud be very helpful.
> 
>    Regards,
>    Vishal.
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 
> 

-- 
Eugene TEO - eugeneteo@symonds.net http://puggy.symonds.net/~eugeneteo/
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux