Ankit Singodia
Ankit Singodia

Reputation: 631

Tomcat Threading Model

Curious to find the maximum number of concurrent requests that can be fulfilled by my app deployed on tomcat.

What I know:

In tomcat configuration there are some parameters to help me with that, like:

  1. 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.

  2. MaxConnections -- 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 accept, but not process, one further connection.

What I'd like to know:

  1. Are the above parameters enough to know max number of 'concurrent' requests that my app can handle?

  2. Lets say max connections are 200, then that means 200 threads will be spawned (1 for each request) if 200 concurrent requests comes in.
    Then let's say, these all are CPU intensive requests/operations. So isn't it performance degrading to spawn 200 threads? I believed that if requests/operations are CPU intensive then the max number of threads spawned out of JVM should complement the number of cores. (say 16).

Upvotes: 1

Views: 246

Answers (1)

GhostCat
GhostCat

Reputation: 140427

Curious to find the maximum number of concurrent requests that can be fulfilled by my app deployed on tomcat.

You can't without taking into account many parameters, such as:

  • hardware horsepower (how many CPUs, what kind of CPU, how much memory)
  • the actual characteristics of your workload

In other words: there can't be a generic / universal answer to your question. If you really worry about exact details, then making experiments is the only way to go.

A "mixed type" workload, running on a powerful state of the art server should be able to easily handle 200 threads in parallel. But of course, if each request causes zillions of IOPS, or needs 1 hour of real CPU time, then 10 requests in parallel could bring you down.

Upvotes: 2

Related Questions