Common configuration of Tomcat Connector

Connector common configuration instructions in Server.xml:

1.port

        As a network server, tomcat needs to expose a socket port to accept the connection of the client, which is specified by the port port.

2.protocol

        Commonly used transmission protocols: (1) HTTP ( HTTP/1.1 or org.apache.coyote.http11.Http11Protocol )

                                   (2) AJP (AJP / 1.3

                                   (3) NIO ( org.apache.coyote.http11.Http11NioProtocol ), this protocol is provided in versions after Tomcat 6.0, which can improve performance when a large amount of data is uploaded and downloaded.

3.redirectPort

       It is generally considered that the http protocol is insecure, while https is secure. After configuring SSL, you can communicate through the https protocol. When the client requests through the https protocol, Tomcat will forward the request to the redirectPort port of SSL. Generally, the default SSL port number of Tomcat is 8443, but the standard SSL port number is 443. If you set it to 443, you can directly access it through https without the trouble of entering the port number.

4.connectionTimeout

        When the client establishes a connection with the server, the client's request data is still not obtained within the connectionTimeout time, and the connection will be disconnected. This value is valid after the connection is established and before the client sends the http-request information.

5.maxPostSize

        The maximum size of the message body in the http-post request, unit: byte, the default value is 2M, the request larger than 2M will be automatically ignored. This has an effect on some form submissions (more text fields). This value can be adjusted moderately. Large file uploads are generally split into small files on the client side instead of sending them directly. Setting this value to less than -1 means unlimited.

6.maxThreads、acceptCount

        maxThreads : The maximum number of threads that tomcat starts, that is, the number of tasks processed at the same time, the default value is 200

       acceptCount : When the number of threads started by tomcat reaches the maximum, the number of queued requests accepted, the default value is 100

         These two properties work

       (1) Accept a request. At this time, the number of threads started by tomcat has not reached maxThreads, and it will start a thread to process the request.

       (2) Accept a request. At this time, the number of threads started by tomcat has reached maxThreads. It will put the request into the waiting queue and wait for idle threads.

       (3) Accept a request. At this time, the number of threads started by tomcat has reached maxThreads, and the number of requests in the waiting queue has reached acceptCount. At this time, tomcat will directly reject the request and return connection refused

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326514027&siteId=291194637