HTTP Keep Alive

May 7, 2009

HTTP (Hyper Text Transfer Protocol) does not maintain a state. For every request that is made to the server, the server sends a response back. When a request is being made, a NEW socket connection is opened on the server from which the response is sent back.

The biggest disadvantage of http is its”slow” response. “Keep-alive” connections phase out this problem for HTTP.

Http keep-alive is also known as “persistent connections”.

In HTTP/1.0 specification, the browser sends the request with the header tag “Connection: Keep-Alive” to which the server responded back with “Connection: Keep-Alive”. For this to happen, it is essential that the browser should support keep-alive. When the next request is sent, the connection is NOT CLOSED and is still alive for further requests until either client or server decides that the connection is over and closes the connection.

In HTTP/1.1 specification, ALL connections to the server are treated to be having “keep-alive” connection unless explicitly stated with “Connection: close” in the headers from the browsers. Some browsers misbehave by hanging the connection. To over come this problem, there is a Keep Alive TimeOut option available in Servers and in Apache it defaults to 15 seconds.

Keep-alive is active with files whose size are known before hand. So dynamic programs stay aside on these cases.

HTTP indicates the end of the previous response and the beggining of the new request thus enabling the reuse of the connection.

Refer:

RFC 2616: http://tools.ietf.org/html/rfc2616#section-8.1

Entry Filed under: LINUX Tips. Tags: , .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


 

May 2009
M T W T F S S
« Apr   Jun »
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

Tags

.htaccess Apache Apache installation Apache Server being secured cakePHP CentOS Client Configuration client installation linux svn command prompt Configuration error cookies cryptography css Fedora gzip output content Hosting applications httpd.conf Linux Beginner linux guides linux notes LINUX Tips linux tricks Linux trips linux tutorial mod_rewrite MySQL MySQL optimisation tips Nagios Notes OpenVPN PHP Programmers RedHat Security server configuration shortcut in linux sIFR alternative Steps OpenVPN client configuration strong crypto subversion Tutorials ubuntu version control VPN Configuration Setup

Archives

Top Posts

Blog Stats

Blogroll