hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: performance tuning possibilities?
Date Thu, 09 Jul 2009 15:30:50 GMT
On Thu, Jul 09, 2009 at 05:05:14PM +0200, Michael wrote:
> I completed my migration to the latest version of the HttpClient
> successfully. It is just a bit slower now than I would have ecpected...
> 
> Maybe somebody has some tuning experiences to share?
> 

Michael,

HttpClient should be _at least_ as fast as HttpClient 3.x. If performance is an
overriding factor for you, you should consider using HttpCore directly and get
30 to 40% performance boost.

http://wiki.apache.org/HttpComponents/HttpClient3vsHttpClient4vsHttpCore



> * Reliability is not that important for me

Make sure to turn off stale connection check and expect-continue handshake.

> * It should do around 20 accesses per minute using slow proxies, connection
> timeout is set to 6 seconds for them. Currently it does those 20 accesses in
> 100 seconds :-(
> 

To find out where time is being spent, turn on context logging. Make sure to
disable the wire log, though, otherwise you will be measuring performance of
console output.

http://hc.apache.org/httpcomponents-client/logging.html


> 
> * I have 3 threads executing http gets concurrently.
> * I am going with ThreadSafeClientConnManager and 30 connections at max. Is
> that enough? Or too much?

You also have to increase the default limit of 2 concurrent connections per
host. It should be at least the same as the number of worker thread to ensure
minimal resource contension.


> * I use a retry hanlder with up to 6 retries. Not sure if that is eating up
> much time?
> * TCPNoDelay is false. Would turning that on improve performance to some
> extent? How much?

Whooooaaaaa! Nagle's algorithm just kills HTTP performance. Make sure the
TCPNoDelay is set to true.

> * Stale Checking is enabled. Maybe I dont need this since I use the
> IdleConnectionMonitorThread doing connMgr.closeExpiredConnections() every 5
> seconds?
> 

The stale connection check is more evil than the Church of Scientology. Just do
not use it.

Hope this helps

Oleg

---------------------------------------------------------------------
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