You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by NGUYEN-VIET Quang <ng...@gmail.com> on 2016/04/29 14:51:33 UTC

Question about ThreadSafeClientConnManager change maxTotal on fly

Hello,

We use httpclient 4.1. ( we plan to upgrade soon)

Juste a simple question about how connection pool behave  when we change
maxTotal on fly, without releasing connetions in use. ( with
releaseConnection() for instance )

If i increase the maxTotal size, I guess that it's not a problem, it simply
allocate more possible connection in pool.

But how about when we decrease the pool's size and all connexions are
pending or occupied, do they become some kind of zombi connection and we
lost control on these connections.

Can you point me out a test to show this feature ?

Finally, is this a good idea to change maxTotal on fly ?

Thanks

Re: Question about ThreadSafeClientConnManager change maxTotal on fly

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2016-04-29 at 14:51 +0200, NGUYEN-VIET Quang wrote:
> Hello,
> 
> We use httpclient 4.1. ( we plan to upgrade soon)
> 
> Juste a simple question about how connection pool behave  when we change
> maxTotal on fly, without releasing connetions in use. ( with
> releaseConnection() for instance )
> 
> If i increase the maxTotal size, I guess that it's not a problem, it simply
> allocate more possible connection in pool.
> 
> But how about when we decrease the pool's size and all connexions are
> pending or occupied, do they become some kind of zombi connection and we
> lost control on these connections.
> 

No, they are not. Those connections will still be kept in the pool and
re-used until they expire. The connection manager however is not going
to allocate new connections until the total number of connections
becomes less or equal to maxTotal.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org