On Thu, 2012-06-14 at 13:08 +0200, Joan Balaguero wrote: > Hello, > > > > I have a servlet that acts as a http proxy. It manages 20 webservices, and > each webservice has its own Multithreaded pool. The total number of > concurrent connections is not higher than 2.000. > > > > Im thinking to use just one pool for all 20 webservices. > > > > Ive not made any tests yet, but what would be the advantages and > disadvantages of using just one pool? > > > > I suppose that Ill earn resources (thread pools, etc) but this 2000 > requests, that now are shared among 20 pools, theyll be served by just one > pool. Can I find any lock contentions or something that makes this change > not recommendable? Anyone using a pool with 2000 (or more) concurrent > requests? Or maybe I should try asyncHttpClient with this level of requests. > > >
Joan It really depends on several factors. Connections pools in HttpClient 4.x are protected with one global lock per pool. So, the larger the pool the more likely are chances of lock contention. However, as long as the number of worker threads is approximately the same as the max number of connections per route, the lock should get acquired and released reasonably fast. At the same time if all your web services are hosted on different hosts with distinct connection routes, connections cannot be shared between endpoints, so you might as well have separate pools of connections for each individual service. Oleg > Thanks, > > Joan. > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
