Why does the spring boot print thread name end at http-nio-8082-exec-10

CSDN Q & A 2022-02-13 09:13:50 阅读数:314

spring boot print thread end

springboot Print thread name to http-nio-8082-exec-10 Just cycle to http-nio-8082-exec-1 了
Thread t = Thread.currentThread();
String name = t.getName();

Take the answer :

Default (min-spare-threads) yes 10 Threads
Because I didn't test sleep So you can't reach the threshold , The minimum number of threads is enough for my request , So it is http-nio-8082-exec-1--http-nio-8082-exec-10 loop
When I use Thread.sleep(2000) When you come to test, it will be up to http-nio-8082-exec-200, If you exceed the threshold, you will be rejected
The root cause is still not well understood

Other answers 2:

Is there only 10 Threads execute concurrently

Other answers 3:

That's because your built-in tomcat Initial active thread Just 10 A! .

copyright:author[CSDN Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130913484509.html