hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: HttpConnection live time
Date Mon, 06 Jul 2015 08:44:21 GMT
On Fri, 2015-07-03 at 16:38 +0300, Серега Красильников wrote:
> I'm sorry, that was missclick!
> <<<
> Good day ladies and gentlemen!
> Short intro: 
> We have an APIs on AWS EC2. We have AWS load balancer (LB) and a lot of instances behind.
Once a time, depends on load, LB is adding new instance with new DNS.
> What we want to have:
> Once in a short period of time kill connection to have a reference on a new Amazon instance.
> What approaches we've found:
> 1. Make HttpClient use NoConnectionReuseStrategy - this might cost a lot for big amount
of requests
> 2. Make HttpConnectionMetrics of each connection hold time of creation (and then calculate
kill it or no)
> 3. Make custom PoolingHttpClientConnectionManager, which would use our custom HttpClientConnection
wrapper to have there creation time.
> Main question we  have is - how  rchitecturally correct do it. 
> >>>
> Thanks, Sergey K.

I second Dmitry here. A combination of a custom connection and a custom
connection re-use strategy sounds like the way to go here. 

Please note though that PoolingHttpClientConnectionManager also supports
Time-To-Live settings out of the box. By using a finite TTL value (say,
one minute) one can ensure that the connection will not get re-used
beyond its TTL. This may also get the job done for you.


Серега, будь ровным пацаном и не кросс-пость 

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

View raw message