tomcat concurrent number

When a process has 500 threads running, the performance is already very low. The maximum number of requests configured by Tomcat by default is 150, which means that 150 concurrent requests are supported at the same time. Of course, it can also be increased.
When an application has more than 250 concurrency, a cluster of application servers should be considered.
How much concurrency can be supported depends on the hardware configuration. The more CPUs, the higher the performance, and the more memory allocated to the JVM, the higher the performance, but it will also increase the burden on the GC.
The operating system has certain restrictions on the number of threads in a process:
Windows The number of threads per process is not allowed to exceed 2000
Linux The number of threads in each process is not allowed to exceed 1000
In addition, in Java, each open thread needs to consume 1MB JVM memory space is used as thread stack.
The maximum concurrent number of Tomcat is configurable. In practice, the maximum concurrent number is closely related to hardware performance and the number of CPUs. Better hardware, more processors will allow Tomcat to support more concurrency.
Tomcat's default HTTP implementation uses blocking Socket communication, and each request needs to create a thread for processing. The amount of concurrency in this mode is limited by the number of threads, but almost no bugs exist for Tomcat.
Tomcat can also configure Socket communication in NIO mode, which is higher in performance than blocking mode. Each request does not need to create a thread for processing, and the concurrency capability is higher than the former. But no blocking maturity.
This concurrency capability is also closely related to the logic of the application. If the logic is complex and requires a lot of calculations, the concurrency capability will inevitably decline. If each request contains a lot of database operations, then the performance of the database is also very high.
For a single database server, there is a limit to the number of client connections allowed.
The problem of concurrency capability involves the entire system architecture and business logic.
The system environment is different, the Tomcat version is different, the JDK version is different, and the modified setting parameters are different. The difference in concurrency is still huge.
maxThreads="1000" Maximum concurrency 
minSpareThreads="100"///Number of threads created during initialization
maxSpareThreads="500"///Once the threads created exceed this value, Tomcat will close socket threads that are no longer needed.
acceptCount="700"// Specify the number of requests that can be placed in the processing queue when all available threads for processing requests are used. Requests that exceed this number will not be processed

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326683753&siteId=291194637