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 SZÜCS Balazs <Ba...@wave-solutions.com> on 2006/05/04 18:00:43 UTC

MultithreadedConnectionManager pooling strategy

Hello,

I'm using HttpClient 3.0-rc4, and I have a question about the connection
pooling strategy of MultithreadedConnectionManager. The reason for that is
that I use an IdleConnectionTimeoutThread (runs every 60 secs, using a
timeout of 60 secs) configured with a MultithreadedConnectionManager, and
idle connections don't seem to get closed by the
IdleConnectionTimeoutThread. However, on a long time span (overnight) the
pool size decreases, but I would expect a quicker reaction, when my
application is not unter heavy load.

I've taken a look at the source of MultithreadedConnectionManager, and I
realized, that free connections are stored in a linked list. On demand the
next free connection is taken from the BEGINNING of the list, while after
usage the connection is put back to the END of the list. This seems to me a
round robin behavior, and it might prevent connections reaching the
predefined age for being recognized as idle. If there is some load, each
free connection will be used, instead of just using a few of them, and
letting the rest age.

Does that make any sense?

Thank you!

Balazs

Re: MultithreadedConnectionManager pooling strategy

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2006-05-04 at 18:00 +0200, SZÜCS Balazs wrote:
> Hello,
> 
> I'm using HttpClient 3.0-rc4, and I have a question about the connection
> pooling strategy of MultithreadedConnectionManager. The reason for that is
> that I use an IdleConnectionTimeoutThread (runs every 60 secs, using a
> timeout of 60 secs) configured with a MultithreadedConnectionManager, and
> idle connections don't seem to get closed by the
> IdleConnectionTimeoutThread. However, on a long time span (overnight) the
> pool size decreases, but I would expect a quicker reaction, when my
> application is not unter heavy load.
> 
> I've taken a look at the source of MultithreadedConnectionManager, and I
> realized, that free connections are stored in a linked list. On demand the
> next free connection is taken from the BEGINNING of the list, while after
> usage the connection is put back to the END of the list. This seems to me a
> round robin behavior, and it might prevent connections reaching the
> predefined age for being recognized as idle. If there is some load, each
> free connection will be used, instead of just using a few of them, and
> letting the rest age.
> 
> Does that make any sense?
> 

Balazs,

Yes, it does. Please file a bug report in Bugzilla. Feel free to provide
a patch for the problem. We love patches ;-)

Oleg

> Thank you!
> 
> Balazs


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