If more simultaneous requests are received than can be handled by the currently available request processing threads, additional threads will be created up to the configured maximum (the value of the?maxThreads?attribute). If still more simultaneous requests are received, they are stacked up inside the server socket created by the?Connector, up to the configured maximum (the value of the?acceptCount?attribute).
所以我們需要設置的是maxThreads和acceptCount這兩個值:
其中,maxThreads的介紹如下:
The maximum number of request processing threads to be created by this?Connector, which therefore determines the maximum number of simultaneous requests that can be handled. If not specified, this attribute is set to 200. If an executor is associated with this connector, this attribute is ignored as the connector will execute tasks using the executor rather than an internal thread pool.
而acceptCount的介紹為:
The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 100.