Tomcat HTTP/1.1 Connector parameter sorting

Source: Internet
Author: User
HTTP/1.1 Connector

 

Overview

The coyote HTTP/1.1 Connector element is a connector component that supports HTTP/1.1. It enables Catalina to execute Servlet and JSP pages and run as a separate web server. The instance of the connector object listens to a specific TCP port on the server. One or more such ctor ins can be configured for a service. Each connector forwards the request to the corresponding engine for processing and generates a response.

When the server starts, connector will create some request processing threads (based on the minprocessors attribute value ). Each request requires a thread to serve it until the service is completed. If the number of requests at the same time exceeds the number of available request processing threads, an additional processing thread is created. The maximum number of threads is maxprocessors. If there are still requests that have reached the maximum number of requests, they are cached in the server socket created by ctor until the upper limit of the cache (defined by the value of the acceptcount attribute ). After this, all requests will receive a "Connection denied" error until some resources can process them.

Attribute
Public attributes

All ctor implementations support the following attributes:

Attribute Description
enableLookups

If you want to call request. getremotehost () for DNS query to return the actual Host Name of the remote client, set enablelookups to true. If you want to ignore DNS queries, only the IP address is returned and set to false (this improves performance ). By default, DNS queries are enabled.

redirectPort If ctor supports non-SSL requests, Catalina automatically redirects the request to the specified port number after receiving a request requiring SSL transmission.
scheme

The name of the Protocol returned when request. getscheme () is called. For example, this attribute may be set to "HTTPS" on SSL connector ". The default value is "HTTP". For more information, see SSL support.

secure

If you want to call request. issecure () to return true on the request received by the connector, set this attribute to true. The default value is false.

Standard Implementation

Coyote HTTP/1.1 ConnectorThe standard implementation is org. Apache. Coyote.Tomcat5. coyoteconnector. It also supports the following additional attributes

Attribute Description
acceptCount

The maximum length of the Connection Request queue when all possible request processing threads are used. If the queue is full, all requests are rejected. The default value is 10.

address For a server with multiple IP addresses, this attribute specifies the address used to listen to a specific port. By default, the port acts on all IP addresses of the server.
bufferSize

Input stream buffer created by ctorSize(In bytes ). By default, buffersize = 2048.

compression

To save server bandwidth, connector may use HTTP/1.1GzipCompression. The acceptable value of this parameter is "off" (no compression is used), "on" (compressed text data), and "force" (forcibly compressed in all cases ), or use a numerical INTEGER (equivalent to "on", but specify the minimum number of data that the output is compressed ). If Content-Length is unknown and compression is set to "on" or stronger, the output will also be compressed. If not specified, this attribute is set to "off"

connectionLinger

When the socket used by connector is closed, the time for retaining the socket, in milliseconds. The default value is-1 (socket linger is not used)

connectionTimeout

After connector accepts a connection, wait for the first request to take effect, in milliseconds. The default value is 60000 (60 seconds)

debug

The log message details. The larger the number, the more detailed the output. If not specified, the default value 0 is used.

disableUploadTimeout This flag allows the servlet iner to use a different, longer connection timeout when executing a servlet. The final result is to give the servlet a longer time to complete its execution, or a longer time-out period during data upload. If not specified, set it to false.
maxKeepAliveRequests The maximum number of HTTP requests received before the server closes the connection. If this value is set to 1, HTTP/1.0 and pipelining are disabled. If not specified, set it to 100.
maxSpareThreads

The maximum number of unused request processing threads allowed before the thread pool starts to stop unnecessary threads. The default value is 50.

 

maxThreads

The maximum number of request processing threads that can be created by connector. This value determines the maximum number of requests that can be processed simultaneously. If not specified, the default value is 200.

minSpareThreads

Number of request processing threads created when ctor Ctor is started for the first time. Connector must also ensure a specified number of idle processing threads. This value should be set to a value smaller than maxthreads. The default value is 4.

port

The TCP port number that the connector creates the server socket and waits for connection. The operating system allows only one server application to listen to a specific port on a specific IP address.

protocol

To use an HTTP processor, the attribute value must be HTTP/1.1 (default)

proxyName

If connector is used in proxy configuration, set this attribute to the name of the server returned when request. getservername () is called. For more information, see Proxy Support.

proxyPort

If connector is used in proxy configuration, this attribute specifies the port value returned by calling request. getserverport. For more information, see Proxy Support.

socketBuffer

Socket output bufferSize. If it is-1, no buffer is used. The default value is 9000 bytes.

tcpNoDelay

If it is true, the tcp_no_delay option is set for the server socket, which can improve the performance in most cases. The default value is true.

Nested components

The only element nested in connector is factory, which is used to configure the factory component of the server set interface. This component is never needed. Currently, this component is supported to workTomcatEarlier versions.

Proprietary features
HTTP/1.1 and HTTP/1.0 support

Connector supports all the necessary features of the HTTP/1.1 protocol (as described in rfc2616), including permanent connections, pipelines, expectations and chunked encoding. If the client (usually a browser) only supports HTTP/1.0, connector will automatically jump back to HTTP/1.0. No special configuration is required to enable this support. Connector also supports HTTP/1.0.

Rfc2616 requires that the HTTP server's response always start with the highest HTTP Version they claim to support. Therefore, this connector ctor always returns HTTP/1.1 at the beginning of its response.

 

Log output

Any debugging or exception information generated by ctor will be automatically routed to the logger of the engine to which the connector belongs. No special configuration is required to enable this support.

 

Proxy Support
In TomcatWhen it is behind the proxy server, you can use the proxyname and proxyport attributes. These attributes modify the return values of calling requset. getservername () and request. getserverport () to construct an absolute URL for redirection. If these values are not set, the return value reflects the name and port number of the server that the proxy server receives the connection, rather than the name and port number of the server initiated by the client.

For more information, see how-

SSL support

For a specific instance of connector, you can set the secure attribute to true to enable SSL support. In addition, you can configure the following attributes:

 

Attribute Description
algorithm

The authentication encoding algorithm used. The default value is sunx509.

 

clientAuth

If the client needs to send a valid certificate chain before accepting a connection, set this value to true. If it is false (the default value), no certificate chain is required. Unless the client request is protected by client-Cert authentication.

 

keystoreFile

The path of the keystore file that stores the server certificate. By default, the path points to the runningTomcat. Keystore in the user's home directory ".

 

keystorePass

The password used to access the server certificate. The default value is not "changeit"

 

keystoreType

The type of the keystore file used to store the server certificate. The default value is not "jks"

 

sslProtocol

The version number of the SSL protocol. The default value is TLS.

 

ciphers

List of available encryption algorithms separated by commas. If not specified, any algorithms can be used.

 

Tomcat HTTP/1.1 Connector parameter sorting

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.