How many requests Tomcat7.0.42 handle at a time.Can we configure the same in any external File.If so where.
The default installation of Tomcat sets the maximum number of HTTP servicing threads at 200. Effectively, this means that the system can handle a maximum of 200 simultaneous HTTP requests.
The default value is 10. maxConnections : the total number of concurrent connections that the server will accept and process. Any additional incoming connections will be placed in a queue until a thread becomes available. The default value for NIO/NIO2 mode is 10,000 and 8,192 for APR/native.
The default value is 60000 (i.e. 60 seconds) but note that the standard server. xml that ships with Tomcat sets this to 20000 (i.e. 20 seconds). Unless disableUploadTimeout is set to false, this timeout will also be used when reading the request body (if any).
The accept queue cannot be monitored, but you can get the number of queued requests for tomcat using Executor. The configuration maxThreads="20" means the threadpool has 20 workers at most, can process 20 requests simultaneously. maxQueueSize="30" means that the threadpool can queued at most 30 unprocessed requests.
It depends on the type connector you are using to accept the requests. There is parameter called maxConnections
in server.xml
that can be configured to throttle the number of incoming requests. Here is the description of maxConnections params for Tomcat 7:
The maximum number of connections that the server will accept and process at any given time. When this number has been reached, the server will not accept any more connections until the number of connections falls below this value. The operating system may still accept connections based on the acceptCount setting. Default value varies by connector type. For BIO the default is the value of maxThreads unless an Executor is used in which case the default will be the value of maxThreads from the executor. For NIO the default is 10000. For APR/native, the default is 8192.
Note that for APR/native on Windows, the configured value will be reduced to the highest multiple of 1024 that is less than or equal to maxConnections. This is done for performance reasons. If set to a value of -1, the maxConnections feature is disabled and connections are not counted
In server.xml
file you specify maxThreads
which specifies maximum number of simultaneous requests that can be handled..
<Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="4443" acceptCount="100" debug="0" connectionTimeout="60000" disableUploadTimeout="true" />
In Tomcat 7,
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.
EDIT : 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.
For more info, refer this link Tomcat 7 Doc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With