- These properties control the generation of the server.xml configuration file. Remark: The file generation doesn't have any logic nor it doesn't do any validation.It's just an XML replacement and adding mechanism. Connector attributes.
- 8.5 2016-06-13 Adds support for HTTP/2, OpenSSL for JSSE, TLS virtual hosting and JASPIC 1.1. Created from Tomcat 9, following delays to Java EE 8. 8.5.65 2021-04-06 9.0 2018-01-18 First Apache Tomcat release to support the Servlet 4.0 specifications. 9.0.45 2021-04-06.
The HTTP2 Upgrade Protocol
When using Tomcat 8.5.15 with HTTP/2 all URL path parameters gets lost. In some cases, session tracking is done via URL (yes, I know, doing that is bad;)). Using the HTTP/2 protocol, the URL contains the 'jsessionid' parameter, but Tomcat creates a new session. It seems, the session ID never reaches the session manager. Tomcat 8.5 supports multiple TLS virtual hosts for a single connector with each virtual host able to support multiple certificates. Virtual host definitions are nested inside the Connector element with the default specified using the defaultSSLHostConfigName attribute on the Connector if more than one virtual host is specified. 20 Tomcat 8.5 timing Possible roadmap 6 months of 8.0.x and 8.5.x Extended if needed. one month between releases after no more 8.0.x releases First 8.5 release 24 March 2016 Current release: 8.5.3 stable Expect last 8.0.x around end of September 2016.
Table of Contents
- Attributes
Introduction
The HTTP Upgrade Protocol element represents an Upgrade Protocol component that supports the HTTP/2 protocol. An instance of this component must be associated with an existing HTTP/1.1 Connector.
HTTP/2 connectors use non-blocking I/O, only utilising a container thread from the thread pool when there is data to read and write. However, because the Servlet API is fundamentally blocking, each HTTP/2 stream requires a dedicated container thread for the duration of that stream.
Attributes
Common Attributes
All implementations of Upgrade Protocol support the following attributes:
Attribute | Description |
---|---|
className | This must be |
Standard Implementation
The HTTP/2 Upgrade Protocol implementation supports the following attributes in addition to the common attributes listed above.
Attribute | Description |
---|---|
allowedTrailerHeaders | By default Tomcat will ignore all trailer headers when processing HTTP/2 connections. For a header to be processed, it must be added to this comma-separated list of header names. |
compressibleMimeType | The value is a comma separated list of MIME types for which HTTP compression may be used. The default value is |
compression | The HTTP/2 protocol may use compression in an attempt to save server bandwidth. The acceptable values for the parameter is 'off' (disable compression), 'on' (allow compression, which causes text data to be compressed), 'force' (forces compression in all cases), or a numerical integer value (which is equivalent to 'on', but specifies the minimum amount of data before the output is compressed). If the content-length is not known and compression is set to 'on' or more aggressive, the output will also be compressed. If not specified, this attribute is set to 'off'. Note: There is a tradeoff between using compression (saving your bandwidth) and using the sendfile feature (saving your CPU cycles). If the connector supports the sendfile feature, e.g. the NIO2 connector, using sendfile will take precedence over compression. The symptoms will be that static files greater that 48 Kb will be sent uncompressed. You can turn off sendfile by setting |
compressionMinSize | If compression is set to 'on' then this attribute may be used to specify the minimum amount of data before the output is compressed. If not specified, this attribute is defaults to '2048'. |
initialWindowSize | Controls the initial size of the flow control window for streams that Tomcat advertises to clients. If not specified, the default value of |
keepAliveTimeout | The time, in milliseconds, that Tomcat will wait between HTTP/2 frames before closing the connection. Negative values will be treated as an infinite timeout. If not specified, a default value of |
maxConcurrentStreamExecution | The controls the maximum number of streams for any one connection that can be allocated threads from the container thread pool. If more streams are active than threads are available, those streams will have to wait for a stream to become available. If not specified, the default value of |
maxConcurrentStreams | The controls the maximum number of active streams permitted for any one connection. If a client attempts to open more active streams than this limit, the stream will be reset with a |
maxHeaderCount | The maximum number of headers in a request that is allowed by the container. A request that contains more headers than the specified limit will be rejected. A value of less than 0 means no limit. If not specified, a default of 100 is used. |
maxHeaderSize | The maximum total size for all headers in a request that is allowed by the container. Total size for a header is calculated as the uncompressed size of the header name in bytes, plus the uncompressed size of the header value in bytes plus an HTTP/2 overhead of 3 bytes per header. A request that contains a set of headers that requires more than the specified limit will be rejected. A value of less than 0 means no limit. If not specified, a default of 8192 is used. |
maxTrailerCount | The maximum number of trailer headers in a request that is allowed by the container. A request that contains more trailer headers than the specified limit will be rejected. A value of less than 0 means no limit. If not specified, a default of 100 is used. |
maxTrailerSize | The maximum total size for all trailer headers in a request that is allowed by the container. Total size for a header is calculated as the uncompressed size of the header name in bytes, plus the uncompressed size of the header value in bytes plus an HTTP/2 overhead of 3 bytes per header. A request that contains a set of trailer headers that requires more than the specified limit will be rejected. A value of less than 0 means no limit. If not specified, a default of 8192 is used. |
noCompressionUserAgents | The value is a regular expression (using |
readTimeout | The time, in milliseconds, that Tomcat will wait for additional data when a partial HTTP/2 frame has been received. Negative values will be treated as an infinite timeout. If not specified, a default value of |
writeTimeout | The time, in milliseconds, that Tomcat will wait to write additional data when an HTTP/2 frame has been partially written. Negative values will be treated as an infinite timeout. If not specified, a default value of |
The HTTP/2 upgrade protocol will also inherit the following limits from the HTTP Connector it is nested with:
- maxCookieCount
- maxParameterCount
- maxPostSize
- maxSavePostSize
Nested Components
This component does not support any nested components.
Special Features
This component does not support any special features.
Notice: This comments section collects your suggestions on improving documentation for Apache Tomcat.
If you have trouble and need help, read Find Help page and ask your question on the tomcat-users mailing list. Do not ask such questions here. This is not a Q&A section.
The Apache Comments System is explained here. Comments may be removed by our moderators if they are either implemented or considered invalid/off-topic.
Description
dotCMS 5.0 ships with Tomcat 8.5 which supports the HTTP2 protocol. HTTP2 is a modern version of HTTP that can combine multiple requests into a single request (among other benefits), greatly increasing client performance when accessing sites. If you are interested in trying to run dotCMS with HTTP2 enabled there are a few things you will need. First off, HTTP2 requires SSL and will not work without it, so you will need a valid certificate file and key. Second, if you are running tomcat without a proxy server or load balancer in front, you will need the APR library installed, which allows tomcat access to system native (non-java) libraries for better performance. You will need to apt-get apr
or yum -i apr
or brew install apr
in order to get this running correctly. Once you do this, hit your site with https and check out your browsers developers tools to insure that you are seeing the connections using HTTP2. Your network connections should look something like the attached image.
And below that is the snippet of code that activates HTTP2 in your server.xml
As Of July 2017, Apache Mod_proxy Doesn't Support HTTP/2.0 Protocol. There Is A Mod_proxy_http21 Module But It Is Still Experimental. Like Detaile...
To learn more about the benefits of the HTTP2 protocol, see: https://en.wikipedia.org/wiki/HTTP/2