Compare Revisions
Connection management in HTTP/1.x
Revision 1120485:
Revision 1120485 by bunnybooboo on
Revision 1120501:
Revision 1120501 by bunnybooboo on
- Title:
- Connection management in HTTP/1.x
- Connection management in HTTP/1.x
- Slug:
- Web/HTTP/Connection_management_in_HTTP_1.x
- Web/HTTP/Connection_management_in_HTTP_1.x
- Tags:
- "Guide" "HTTP" "Performance" "WebMechanics" "Performance"
- "Guide" "HTTP" "Performance" "WebMechanics" "Performance"
- Comment:
- editorial review of short-lived
- peristent connections editorial review
- Content:
-
Revision 1120485 Revision 1120501 n 54 Short-lived connections have two major drawbacks: the time n 54 Short-lived connections have two major hitches: the time ta > to establish a new connection is significant, and the performance > ken to establish a new connection is significant, and performance > of the underlying TCP connection gets better only when this conn > of the underlying TCP connection gets better only when this conn > ection has been in use for some time (warm connection). To mitiga > ection has been in use for some time (warm connection). To ease t > te this problem, even before HTTP/1.1, the concept of a <em>persi > hese problems, the concept of a <em>persistent connection</em> ha > stent connection</em> has been crafted, sometimes called a <em>ke > s been designed, even prior to HTTP/1.1. Alternatively this may b > ep-alive connection</em>. > e called a <em>keep-alive connection</em>. n 57 A persistent connection is a connection that stays open for n 57 A persistent connection is a one which remains open for a p > some time and that can be reused for several requests, sparing t > eriod, and can be reused for several requests, saving the the nee > he TCP handshake and making better use of the TCP performance cap > d for a new TCP handshake, and utilizing TCP's performance enhanc > abilities. The connection will not stay open forever: idle connec > ing capabilities. This connection will not stay open forever: idl > tions are closed after some time (a server may use the {{HTTPHead > e connections are closed after some time (a server may use the {{ > er("Keep-Alive")}} header to give a minimum amount of time they s > HTTPHeader("Keep-Alive")}} header to specify a minimum time the c > hould be kept open). > onnection should be kept open). n 60 Persistent connections also have drawbacks; even when idlin n 60 Persistent connections also have drawbacks; even when idlin > g they consume some server resources and under heavy load, {{glos > g they consume server resources, and under heavy load, {{glossary > sary("DoS attack", "DoS attacks")}} can be conducted. In these ca > ("DoS attack", "DoS attacks")}} can be conducted. In such cases, > ses, using non-persistent connections, that are closed as soon as > using non-persistent connections, which are closed as soon as the > they are idle, brings better performance. > y are idle, can provide better performance. n 63 HTTP/1.0 connections are not persistent by default. Setting n 63 HTTP/1.0 connections are not persistent by default. Setting > {{HTTPHeader("Connection")}} to anything other than <code>close< > {{HTTPHeader("Connection")}} to anything other than <code>close< > /code>, usually <code>retry-after</code> will make them persisten > /code>, usually <code>retry-after</code>, will make them persiste > t. > nt. t 66 On the other hand, on HTTP/1.1, they are persistent by defa t 66 In HTTP/1.1, peristence is the default, and the header is n > ult and the header is not needed (but often added so that it is t > o longer needed (but often added in case of a fallback to HTTP/1. > aken into account in case of a fallback to HTTP/1.0). > 0).