Reputation: 55
Is there a way to configure the threads in the thread pool using Apache HttpClient?
I came across Max connections total . How is this related to the threads in the thread pool? My understanding is each connection will have a pool of threads and setting this property would only configure the number of connections I can have. Is that correct ? I set this value to 105(because my application has some logic to take the max of (100, user input)), started my application and I am monitoring the total thread count in Jconsole to see if this goes past the value. Is this the right way to do this ?
Upvotes: 0
Views: 1340
Reputation: 55
How is max connections total related to the threads in the thread pool?
Max connections total is not related to the threads in the thread pool. Max connections total is the number of connections can the client keep open at a given time. It's value should be atleast equivalent to the number of worker threads contending for the connections. It should be more or equivalent to the max connections per route. Max connections per route denote the number of connections the client can keep open for a specific route/endpoint.
What is the right way to configure and monitor the number of threads in the thread pool ?
The thread pool is configured on the web server . In case I was using Jetty
server. In the jetty server - the thread pool can be configured by setting the
maxThreads value.
This can be monitored by looking at the JettyServer Mbeans in JConsole
Upvotes: 0