HTTP persistent connection: Difference between revisions
Add reference to refereed performance paper |
Put in proper citation to substantiate the performance statements and other benefits. |
||
Line 9: | Line 9: | ||
* Errors can be reported without the penalty of closing the TCP connection |
* Errors can be reported without the penalty of closing the TCP connection |
||
According to RFC 2616 (page 47), a single-user client should not maintain more than 2 connections with any server or proxy. A [[proxy server|proxy]] should use up to 2×<var>N</var> connections to another server or proxy, where <var>N</var> is the number of simultaneously active users. These guidelines are intended to improve HTTP response times, avoid congestion. There is no HTTP performance benefit of additional connections, if HTTP pipelining over the TCP connection is correctly implemented, while significant issues with causing congestion, to the user or |
According to RFC 2616 (page 47), a single-user client should not maintain more than 2 connections with any server or proxy. A [[proxy server|proxy]] should use up to 2×<var>N</var> connections to another server or proxy, where <var>N</var> is the number of simultaneously active users. These guidelines are intended to improve HTTP response times, avoid congestion. There is no HTTP performance benefit of additional connections, if HTTP pipelining over the TCP connection is correctly implemented, while significant issues with causing congestion, to the user or other users.<ref>{{Citation |
||
| last = Nielssen |
|||
| first = Henryk |
|||
| last2 = Gettys |
|||
| first2 = James |
|||
| author2-link = [Jim Gettys] |
|||
| last3 = et. al. |
|||
| title = Network Performance Effects of HTTP/1.1, CSS1, and PNG |
|||
| journal = Computer Communication Review |
|||
| volume = 27 |
|||
| issue = 4 |
|||
| date = September 17, 1997 |
|||
| year = 1997 |
|||
| month = October |
|||
| url = http://conferences.sigcomm.org/sigcomm/1997/papers/p102.html |
|||
| issn = 0146-4833}}</ref> |
|||
== Use in web browsers == |
== Use in web browsers == |
Revision as of 15:20, 5 August 2010
HTTP |
---|
![]() |
Request methods |
Header fields |
Response status codes |
Security access control methods |
Security vulnerabilities |
HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse, is the idea of using the same TCP connection to send and receive multiple HTTP requests/responses, as opposed to opening a new connection for every single request/response pair.
Advantages
- Less CPU and memory usage (because fewer connections are open simultaneously)
- Enables HTTP pipelining of requests and responses
- Reduced network congestion (fewer TCP connections)
- Reduced latency in subsequent requests (no handshaking)
- Errors can be reported without the penalty of closing the TCP connection
According to RFC 2616 (page 47), a single-user client should not maintain more than 2 connections with any server or proxy. A proxy should use up to 2×N connections to another server or proxy, where N is the number of simultaneously active users. These guidelines are intended to improve HTTP response times, avoid congestion. There is no HTTP performance benefit of additional connections, if HTTP pipelining over the TCP connection is correctly implemented, while significant issues with causing congestion, to the user or other users.[1]
Use in web browsers
![](http://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/HTTP_persistent_connection.svg/300px-HTTP_persistent_connection.svg.png)
Netscape Navigator (since at least 4.05) and Internet Explorer (since at least 4.01) support persistent connections to Web servers and proxies.
Netscape doesn't close persistent connections using timeout. All idling persistent connections are queued. When there is a need to open new persistent connections while connecting to a different server, the idle connections are killed by the browser using some form of LRU algorithm.[2]
Internet Explorer supports persistent connections. By default, versions 6 and 7 use 2 persistent connections while version 8 uses 6.[3] Persistent connections time out after 60 seconds of inactivity which is changeable via the Windows Registry.[4]
Mozilla Firefox supports persistent connections. The number of simultaneous connections can be customized (per-server, per-proxy, total). Persistent connections time out after 300 seconds (5 minutes) of inactivity which is changeable via the configuration.[5]
Opera supports persistent connections since 4.0.[6] The number of simultaneous connections can be customized (per-server, total).
References
- ^ Nielssen, Henryk; Gettys, James; et al. (September 17, 1997), "Network Performance Effects of HTTP/1.1, CSS1, and PNG", Computer Communication Review, 27 (4), ISSN 0146-4833
{{citation}}
: Check|author2-link=
value (help); Explicit use of et al. in:|last3=
(help); Unknown parameter|month=
ignored (help)CS1 maint: date and year (link) - ^ Zhe Wang and Pei Cao (1998-12-09). "Persistent Connection Behavior of Popular Browsers". University of Wisconsin-Madison. Retrieved 2009-07-08.
- ^ "IE8 speeds things up". stevesouders.com. 2008-03-10. Retrieved 2009-07-17.
- ^ "How to change the default keep-alive time-out value in Internet Explorer". Microsoft. 2007-10-27. Retrieved 2009-07-17.
- ^ "Network.http.keep-alive.timeout". mozillazine.org. Retrieved 2009-07-17.
- ^ "Opera 4.0 Upgrades File Exchange: Includes HTTP 1.1". Opera Software. 2000-03-28. Retrieved 2009-07-08.