Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the tomcat default thread pool size so large?

I notice that default tomcat 7 thread pool size seems to be 200.

But normal CPU seems have 16 cores.

So only 16 threads can be executed paralleld

Why does tomcat use so much threads.

like image 689
jilen Avatar asked Jan 10 '13 02:01

jilen


People also ask

What is the default thread pool count in Tomcat server?

The number of threads in the pool depends on the parameters you've set for the connector in your conf/server. xml file. By default, Tomcat sets maxThreads to 200, which represents the maximum number of threads allowed to run at any given time.

What is the default thread pool size in spring boot?

The default configuration is a core pool size of 1, with unlimited max pool size and unlimited queue capacity. This is roughly equivalent to Executors.

What is the max thread pool size?

ThreadPool will create maximum of 10 threads to process 10 requests at a time. After process completion of any single Thread, ThreadPool will internally allocate the 11th request to this Thread and will keep on doing the same to all the remaining requests.

What is default thread pool size in Java?

Default Java thread stack size is 1 MB for 64-bit JVMs. That is why creating a new thread for each request when requests are frequent and lightweight is a waste of resources. Thread pools can handle thread lifecycle automatically according to the strategy selected on thread pool creation.


1 Answers

For long years many single core computer have been around and were able to run functions in a "pseudo-parallel" mode, that said, you might have 16 threads running in real parallel mode and others running in pseudo parallel.

For more information look at this: Parallel Computing

To answer your question, these threads are useful to process requests, a bunch of them will be used for attending http requests and others will be used on calling the application logic.

like image 61
Juan Alberto López Cavallotti Avatar answered Sep 28 '22 10:09

Juan Alberto López Cavallotti