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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…