From df86c04b256a71efa01c386544f3fb13c9e61b06 Mon Sep 17 00:00:00 2001
From: Luca Toscano This module provides HTTP/2 (RFC 7540) support for the Apache
- HTTP Server. This module provides HTTP/2 (RFC 7540)
+ support for the Apache HTTP Server. This module relies on libnghttp2
to provide the core http/2 engine. This module is experimental. Its behaviors, directives, and
- defaults are subject to more change from release to
- release relative to other standard modules. Users are encouraged to
- consult the "CHANGES" file for potential updates. This module is experimental. Its behaviors, directives, and
+ defaults are subject to more change from release to
+ release relative to other standard modules. Users are encouraged to
+ consult the "CHANGES" file for potential updates. You must enable HTTP/2 via You must enable HTTP/2 via Two useful configuration schemes are: Allows HTTP/2 negotiation (h2) via TLS ALPN in a secure Allows HTTP/2 negotiation (h2) via TLS ALPN for secure Refer to the official HTTP/2 FAQ for any doubt about the protocol.
+ Enabling HTTP/2 on your Apache Server has impact on the resource
+ consumption and if you have a busy site, you may need to consider
+ carefully the implications.
+
+ The first noticeable thing after enabling HTTP/2 is that your server
+ processes will start additional threads. The reason for this is that
+ HTTP/2 gives all requests that it receives to its own Worker
+ threads for processing, collects the results and streams them out
+ to the client.
+
+ In the current implementation, these workers use a separate thread
+ pool from the MPM workers that you might be familiar with. This is
+ just how things are right now and not intended to be like this forever.
+ (It might be forever for the 2.4.x release line, though.) So, HTTP/2
+ workers, or shorter H2Workers, will not show up in mod_status. They
+ are also not counted against directives such as ThreadsPerChild. However
+ they take ThreadsPerChild as default if you have not configured something
+ else via
+ Another thing to watch out for is is memory consumption. Since HTTP/2
+ keeps more state on the server to manage all the open request, priorities
+ for and dependencies between them, it will always need more memory
+ than HTTP/1.1 processing. There are three directives which steer the
+ memory footprint of a HTTP/2 connection:
+
+
+
+ And last, but not least,
+ If you serve a lot of static files,
+ Many sites use the same TLS certificate for multiple virtual hosts. The
+ certificate either has a wildcard name, such as '*.example.org' or carries
+ several alternate names. Browsers using HTTP/2 will recognize that and reuse
+ an already opened connection for such hosts.
+
+ While this is great for performance, it comes at a price: such vhosts
+ need more care in their configuration. The problem is that you will have
+ multiple requests for multiple hosts on the same TLS connection. And that
+ makes renegotiation impossible, in face the HTTP/2 standard forbids it.
+
+ So, if you have several virtual hosts using the same certificate and
+ want to use HTTP/2 for them, you need to make sure that all vhosts have
+ exactly the same SSL configuration. You need the same protocol,
+ ciphers and settings for client verification.
+
+ If you mix things, Apache httpd will detect it and return a special
+ response code, 421 Misdirected Request, to the client.
+ This module can be configured to provide HTTP/2 related information
+
+ This module can be configured to provide HTTP/2 related information
as additional environment variables to the SSI and CGI namespace, as well
as in custom log configurations (see h2
(HTTP/2 over TLS) and h2c
(HTTP/2 over TCP).h2
.%{VAR_NAME}e
).
H2_STREAM_ID
number HTTP/2 stream number of this request.
-
+ H2_STREAM_TAG
string HTTP/2 process unique stream identifier, consisting of connection id and stream id separated by -
.
The push diary records a digest (currently using a 64 bit number) of pushed resources (their URL) to avoid duplicate pushes on the same connection. - These value are not persisted, so clients openeing a new connection + These value are not persisted, so clients opening a new connection will experience known pushes again. There is ongoing work to enable a client to disclose a digest of the resources it already has, so the diary maybe initialized by the client on each connection setup. @@ -235,7 +346,7 @@
@@ -269,12 +380,12 @@ When a stream has more than one dependant, say X1 and X2 both depend on Y, the weight determines the bandwidth allocation. If X1 and X2 have the same weight, they both get - half of the available bandwdith. If the weight of X1 is twice + half of the available bandwidth. If the weight of X1 is twice as large as that for X2, X1 gets twice the bandwidth of X2.
Ultimately, every stream depends on the root stream which - gets all the bandwidht available, but never sends anything. So all + gets all the bandwidth available, but never sends anything. So all its bandwidth is distributed by weight among its children. Which either have data to send or distribute the bandwidth to their own children. And so on. If none of the children have data @@ -352,7 +463,7 @@
This directive toggles the security checks on HTTP/2 connections @@ -673,7 +784,7 @@ H2PushPriority text/css interleaved # weight 256 default
Measurements by google performance - labs show that best performance on TLS connections is reached, + labs show that best performance on TLS connections is reached, if initial record sizes stay below the MTU level, to allow a complete record to fit into an IP packet.
@@ -772,99 +883,4 @@ H2PushPriority text/css interleaved # weight 256 default
- This directive sets the timeout for read/write operations on
- connections where HTTP/2 is negotiated. This can be used server wide or for specific
-
- This directive is similar to the
-
- A value of 0 enforces no timeout. -
-
- This directive sets the timeout for read/write operations on
- idle connections where HTTP/2 is negotiated. This can be used server wide or for specific
-
- This directive is similar to the
-
- By default, for non-async MPMs (prefork, worker) the keepalive timeout - will be the same as H2Timeout. For async MPMs, the keepalive handling for - HTTP/1 connections applies as no special action is taken. -
-
- This directive sets the timeout for read/write operations on
- HTTP/2 streams, e.g. individual requests. This can be used server wide or for specific
-
- Due to the nature of HTTP/2, which sends multiple requests over a single - connection and has priority scheduling, individual streams might not - see input for much longer times than HTTP/1.1 requests would. -
-- A value of 0 enforces no timeout, so could wait on chances to receive - input or write data indefinitely. This expose a server to - risks of thread exhaustion. -
-- Depending on your handling of pushed streams, - priorities and general responsiveness, a site might need to increase - this value. For example, if you PUSH a large resource before - the requested one, the initial stream will not write until the - pushed resource is fully sent. -
-