Reputation: 3274
I have set the maxThreads as 32, But in my logs I am seeing way more than the actual count.
<Connector port="8080"
protocol="HTTP/1.1"
maxThreads="32" connectionTimeout="20000" redirectPort="8443"
compression="on"
compressionMinSize="512"
compressableMimeType="application/json"
/>
Logs:
24 Oct 2018 13:27:15,378 [INFO,XXX,http-apr-8080-exec-172]
Does it mean that this is the 172 thread? I thought the thread pool will be limited to 32 since I have given maxThreads. And I dont have any custom executor defined as well
Upvotes: 0
Views: 163
Reputation: 7569
Basically, as explained in this answer, the ID for threads in Java are not guaranteed to start from zero or to be contiguous when created.
Here in the code you can see that their ID is set with a sequence incremented somehow.
Once again, I recommend you to run some profiling tool in your Java app to see the actual number of threads being created in the pool at a given time.
Upvotes: 1