hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpindyala <mohan.pindy...@rovicorp.com>
Subject Re: httpclient.defaultMaxPerRoute and maxTotalConnections questions
Date Wed, 07 Dec 2011 23:39:11 GMT



William Speirs wrote:
> 
> On Tue, Dec 6, 2011 at 1:30 PM, mpindyala <mohan.pindyala@rovicorp.com>
> wrote:
>>> Yes , its just a thread .  We did this to save 10-30ms for each http
>>> request that application does to back end providers. It seems connection
>>> manager takes 10-30ms just to close idle and expired connections before
>>> they can be reused.  Please let us know if there are any pitfalls of
>>> doing
>>> this.
> 
> I don't know if this makes sense... if the connection is idle it can
> be re-used for another request, why would you close it? You can
> however set the max amount of time the ThreadSafeClientConnManager
> will keep a connection open for:
> http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.html#ThreadSafeClientConnManager(org.apache.http.conn.scheme.SchemeRegistry,
> long, java.util.concurrent.TimeUnit)
> 
> Thanks you Bill, I really appreciate your input.
> 
> So we are closing idleconnections only if they are idle for  longer than
> 10 seconds. we will retest our app with your suggestion and see the
> performance impact.
> 
>>> The reason we set those numbers high as a protection, our third responds
>>> within 500ms most of the time.
>>> It is just when there is something going on between hops , the delay is
>>> seem.
>>> So one questions which still needs clarification is
>>>  httpclient.defaultMaxPerRoute = 10000
>>> httpclient.maxTotalConnections = 20000
>>>
>>> is defaultMaxPerRoute  is per third party service we are calling ? if
>>> yes
>>> then
>>> if there are 4 services we have to call then settings should be
>>> httpclient.defaultMaxPerRoute = 10000
>>> httpclient.maxTotalConnections = 40000
>>> Each route getting 10000 , is that assumption correct ?
> 
> I would need Oleg to verify (or spend more time than I want checking
> the source), but these are different things. From the docs for
> ConnPoolByRoute
> (http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.html),
> "connections are re-used only for the exact same route" & "connection
> limits are enforced per route rather than per host". So as I
> understand it a route and a host/connection are NOT the same thing. So
> you could have 4 as your MaxPerRoute and 1 as your
> maxTotalConnections... I don't think maxPerRoute >
> maxTotalConnections.
> 
> so you are saying  max per route cannot be more than maxtotal connections
> ?
> 
>>> we want to support upto 4M per hour
> 
> Depending upon a lot of factors 4M per hour should be doable... I've
> been able to get 65K per sec.
> Can I get your httpclient settings for achieving 65k per sec ? it would be
> really useful to us.
> 
> Thank you 
> Mohan
> 
> Bill-
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/httpclient.defaultMaxPerRoute-and-maxTotalConnections-questions-tp32921044p32930550.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


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


Mime
View raw message