Re: Regarding Keep-Alive doubt

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

 



On Mon, 19 Apr 2004 20:29:48 +0800
Eugene Teo <eugene.teo@eugeneteo.net> wrote:

 
> >    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?

The client wud request the connection to be kept-alive so that more that one request can 
served by one connection.

This is the request which i captured from the client(Opera Browser),even other browsers wud send similar kindaa request.

******************************************************
GET /old.html HTTP/1.0
User-Agent: Opera/7.23 (X11; Linux i686; U)  [en]
Accept: text/html, application/xml;q=0.9, application/xhtml+xml;q=0.9, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1
Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
Via: 1.0 squid.odysseytec.com:8080 (squid/2.5.STABLE1)
X-Forwarded-For: unknown
Host: 192.168.1.97:4999
Cache-Control: max-age=259200
Connection: keep-alive
******************************************************

And if we notice the last parameter, Connection: Keep-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.

Yeah, this is true that the user-space program will implement its keep-alive mechanism,
as i mentioned in the previous mail

***********
 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.
 and Thats what i wonder, what wud be the TCP Keep-Alive and where it plays its role.
***********

> 
> >    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?

No, it did n't. The second request was served on the same connection, 
I have checked RFC 1122's keep-alive section. We do have explanation of minimum time shud be 2hrs, 
but where it plays its role, i don't understand.


Regards,
Vishal.

--
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