hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Moore <j...@apache.org>
Subject idle connections / connection reuse
Date Wed, 13 Jul 2011 16:55:42 GMT
Hi folks,

As a result of looking into the adaptive connection pools, I noticed
that the ConnPoolByRoute uses a queue to manage its open, reusable
connections, meaning the connections get used in a FIFO (round-robin)
fashion. One downside of this is that if the client currently has more
connections open than it really needs to keep up, it won't ever close
them.

For example, suppose during a burst of activity, the client ends up
with 3 open connections, but then settles down to a steady-state of
executing 2 requests per second, where each request takes 1 second on
average. In theory, the client could be getting away with just using
two connections here, but because the 3 existing connections are used
in a round-robin fashion, none of them are ever reclaimed and closed
by the "close idle connections" mechanism.

I think if the ConnPoolByRoute simply used a stack (LIFO) instead of a
queue that any excess capacity in terms of open connections would
eventually get reclaimed. I'm going to prototype this quickly, but
wanted to see if anyone else had any feedback.

Jon

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


Mime
View raw message