- The Apache HttpComponents project is responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols. This project functions under the Apache Software Foundation ( ), and is part of.
- Apache Lounge is all about the Apache Web Server provided by the Apache Software Foundation (ASF) HTTPD Server Project. Apache Lounge has provided up-to-date Windows binaries and popular third-party modules for more than 15 years. We have hundreds of thousands of satisfied users: small and big companies as well as home users.
HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse, is the idea of using a single TCP connection to send and receive multiple HTTP requests/responses, as opposed to opening a new connection for every single request/response pair. The newer HTTP/2 protocol uses the same idea and takes it further to allow multiple concurrent requests/responses to be multiplexed over a single connection.
Operation[edit]
The Hyper-Text Transfer Protocol (HTTP) is perhaps the most significant protocol used on the Internet today. Web services, network-enabled appliances and the growth of network computing continue to expand the role of the HTTP protocol beyond user-driven web browsers, while increasing the number of applications that require HTTP support.
HTTP 1.0[edit]
Under HTTP 1.0, connections are not considered persistent unless a keep-alive header is included,[1] although there is no official specification for how keepalive operates. It was, in essence, added to an existing protocol. If the client supports keep-alive, it adds an additional header to the request:
Then, when the server receives this request and generates a response, it also adds a header to the response:
Following this, the connection is not dropped, but is instead kept open. When the client sends another request, it uses the same connection. This will continue until either the client or the server decides that the conversation is over, and one of them drops the connection.
HTTP 1.1[edit]
In HTTP 1.1, all connections are considered persistent unless declared otherwise.[2] The HTTP persistent connections do not use separate keepalive messages, they just allow multiple requests to use a single connection. However, the default connection timeout of Apache httpd 1.3 and 2.0 is as little as 15 seconds[3][4] and just 5 seconds for Apache httpd 2.2 and above.[5][6] The advantage of a short timeout is the ability to deliver multiple components of a web page quickly while not consuming resources to run multiple server processes or threads for too long.[7]
Keepalive with chunked transfer encoding[edit]
Keepalive makes it difficult for the client to determine where one response ends and the next response begins, particularly during pipelined HTTP operation.[8] This is a serious problem when Content-Length
cannot be used due to streaming.[9] To solve this problem, HTTP 1.1 introduced a chunked transfer coding that defines a last-chunk
bit.[10] The last-chunk
bit is set at the end of each response so that the client knows where the next response begins.
Advantages[edit]
- Reduced latency in subsequent requests (no handshaking).
- Reduced CPU usage and round-trips because of fewer new connections and TLS handshakes.
- Enables HTTP pipelining of requests and responses.
- Reduced network congestion (fewer TCP connections).
- Errors can be reported without the penalty of closing the TCP connection.
According to RFC 7230, section 6.4, 'a client ought to limit the number of simultaneous open connections that it maintains to a given server'. The previous version of the HTTP/1.1 specification stated specific maximum values but in the words of RFC 7230 'this was found to be impractical for many applications... instead... be conservative when opening multiple connections'. These guidelines are intended to improve HTTP response times and avoid congestion. If HTTP pipelining is correctly implemented, there is no performance benefit to be gained from additional connections, while additional connections may cause issues with congestion.[11]
Disadvantages[edit]
If the client does not close the connection when all of the data it needs has been received, the resources needed to keep the connection open on the server will be unavailable for other clients. How much this affects the server's availability and how long the resources are unavailable depend on the server's architecture and configuration.
Also a race condition can occur where the client sends a request to the server at the same time that the server closes the TCP connection.[12] A server should send a 408 Request Timeout status code to the client immediately before closing the connection. When a client receives the 408 status code, after having sent the request, it may open a new connection to the server and re-send the request.[13] Not all clients will re-send the request, and many that do will only do so if the request has an idempotent HTTP method.
Use in web browsers[edit]
All modern web browsers including Google Chrome, Firefox, Internet Explorer (since 4.01), Opera (since 4.0)[14] and Safari use persistent connections.
By default, Internet Explorer versions 6 and 7 use two persistent connections while version 8 uses six.[15] Persistent connections time out after 60 seconds of inactivity which is changeable via the Windows Registry.[16]
In Firefox, the number of simultaneous connections can be customized (per-server, per-proxy, total). Persistent connections time out after 115 seconds (1.92 minutes) of inactivity which is changeable via the configuration.[17]
See also[edit]
- HTTP pipelining, whereby multiple requests can be sent without waiting for a response
- HTTP/2, which allows out-of-order pipelining of requests and responses, and also predictive pushing of content before it has been requested
References[edit]
Apache Redirect Https
- ^'The TCP/IP Guide - HTTP Persistent Connection Establishment, Management and Termination'. www.tcpipguide.com. Archived from the original on 2017-05-21. Retrieved 2017-12-31.
- ^Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing, Persistence
- ^Apache HTTP Server 1.3 – KeepAliveTimeout Directive
- ^Apache HTTP Server 2.0 – KeepAliveTimeout Directive
- ^Apache HTTP Server 2.2 – KeepAliveTimeout Directive
- ^Apache HTTP Server 2.4 – KeepAliveTimeout Directive
- ^Multiple (wiki). 'Httpd/KeepAlive'. Docforge. Archived from the original on January 6, 2010. Retrieved 2010-01-30.
- ^'HTTP: What are the relations between pipelining, keep alive and server sent events'.
- ^'HTTP Streaming (or Chunked vs Store & Forward)'.
- ^'Chunked Transfer Coding'.
- ^Nielssen, Frystyk Henryk; Gettys, James; Baird-Smith, Anselm; Prud’hommeaux, Eric; Wium Lie, Håkon; Lilley, Chris (October 1997), 'Network Performance Effects of HTTP/1.1, CSS1, and PNG', Computer Communication Review, 27 (4), ISSN0146-4833
- ^[1]
- ^[2]
- ^'Opera 4.0 Upgrades File Exchange: Includes HTTP 1.1'. Opera Software. 2000-03-28. 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.
External links[edit]
Whether you need a quick reference for a command, or an in-depth walk-through of setting up a high volume database server, we aim to provide you with information required to get the job done quickly and easily.
The main reason for the existence of the Apache Community is to promote the sharing of knowledge and experience among our members. Whether you are a complete beginner or a seasoned professional with years of on the site experience, we hope to have some nuggets of information that will bring new light to the installation, configuration, or maintenance of Apache and related applications.
Order Apache-based Web Hosting
Apache Server Windows
Looking for a quality Apache web hosting provider? We have partnered with one of the most reliable and friendliest host out there.
Compare the Most Popular Web Hosts
It can be difficult finding the right web hosting for your website. We’ve spent the time to evaluate and rate some of the most popular web hosting companies on the market, so you can use our below table to make the right choice in web hosting. FatCow hosting offers one of the most affordable shared hosting offerings while delivering excellent quality of service and customer support.
Rank | Web Host | Features | Bonuses | Hosting Review |
---|---|---|---|---|
1 | FatCow Cheap Business Hosting | Space: UnlimitedTraffic: Unlimited Price: $3.67 | Free Domain Forever,Host Unlimited Domains,$75 Marketing Bonus | Review FatCow |
2 | JustHost Editor’s Choice Hosting | Space: UnlimitedTraffic: UnlimitedPrice: $3.95 | Free Domain Forever,Host Unlimited Domains,$75 Marketing Bonus | Review JustHost |
3 | GreenGeeks Green Web Hosting | Space: UnlimitedTraffic: UnlimitedPrice: $6.95 | Free Domain Forever,Host Unlimited Domains,$25 Marketing Bonus | Review GreenGeeks |
4 | WebHostingPad Cheap Reliable Hosting | Space: UnlimitedTraffic: UnlimitedPrice: $1.99 | Free Domain Forever,Host Unlimited Domains,$100 Marketing Bonus | Review WebHostingPad |
5 | Inmotion Business Web Hosting | Space: UnlimitedTraffic: UnlimitedPrice: $8.95 | Free Domain Name,Choice of Data Centers,Top Technical Support | Review Inmotion |
6 | Hostmonster Cheap Unix Hosting | Space: UnlimitedTraffic: UnlimitedPrice: $6.95 | Free Domain Forever,Host Unlimited Domains,$75 Marketing Bonus | Review Hostmonster |
7 | Globat Cheap Web Hosting | Space: UnlimitedTraffic: UnlimitedPrice: $4.44 | Free Domain Name,Host Unlimited Domains,$55 Marketing Bonus | Review Globat |
8 | Lunarpages Cheap Shared Hosting | Space: UnlimitedTraffic: UnlimitedPrice: $4.95 | Free Domain Forever,Host Unlimited Domains,Free $775 in Software | Review Lunarpages |
9 | GoDaddy Largest Web Hosting | Space: UnlimitedTraffic: UnlimitedPrice: $12.74 | Free Domain Name,Host Unlimited Domains,Free SSL Certificate | Review GoDaddy |
10 | Bluehost Unlimited Web Hosting | Space: UnlimitedTraffic: UnlimitedPrice: $6.95 | Free Domain Forever,Host Unlimited Domains,$75 Marketing Bonus | Review Bluehost |
Web Hosting for Apache.com provided by Burke & Eisner, Help with Benzene Leukemia Lawsuits