Reputation: 21
I am asking the community here as i am confused with contradicting info i am finding about this on web. I have read that "By default, Tomcat in Spring Boot has a thread pool consisting of a maximum of 200 threads" . At the same time i have also read that "By default, the number of requests that Spring Boot can handle simultaneously = maximum connections (8192) + maximum waiting number (100), resulting in 8292" . So is it like using 200 threads spring boot can handle 8192 connections simultaneously at a time ? or one of the information above is wrong . We are using Spring boot 3.x.x in our apps.
In our app logs I can see that, for example "09:58:52.763 [http-nio-8085-exec-488]" which makes me to believe its using 488th thread , but if there are only 200 threads how can it go to 488. So confused :(. I humbly request knowledgeable folks to give more clarity or give me a document reference i can read abt.
Upvotes: 2
Views: 583
Reputation: 44368
This is my basic understanding of Tomcat threads and concurrency:
The concurrency limit 8192 says how many simultaneous connections Tomcat can handle. It does not mean that Tomcat handles all of them at once.
These 200 threads manage the concurrent connections. The threads themselves are reused. Moreover, not all the connections are active, a good number of them can be waiting.
Honestly, I have no idea about what exactly http-nio-8085-exec-488
represents. Perhaps some of the threads are removed and new ones are created but it is my wild guess. Perhaps the number is not related to the threads at all. I'd rather wait for someone more enlightened for a correct explanation.
Upvotes: 1