hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: question about performance
Date Thu, 08 Apr 2004 19:22:47 GMT
(1) First and foremost DO reuse HttpClient instances when using
multi-threaded connection manager. HttpClient class is thread-safe. In
fact there are no known problems with having just one instance of
HttpClient per application. Using a new instance of HttpClient for
processing each request totally defeats all the performance
optimizations we have built into HttpClient

(2) Use multi-threaded connection manager in case you do not

(3) Disable stale connection check

(4) Do not use connect timeout which causes a controller thread to be
spawned per connection attempt


On Thu, 2004-04-08 at 21:02, Alvarez, Gil wrote:
> We recently ported our url-hitting code from using java.net.* code to
> httpclient code. We use it in a high-volume environment (20 machines are
> hitting an external 3rd party to retrieve images).
> After the port, we saw a significant increase in cycles used by the
> machines, about 2-3 times (ie, the load on the boxes increased from
> using up 20% of the cpu, to about 50%-60% of the cpu.
> For each request, we instantiate an HttpClient object, and a GetMethod
> object, and shut things down afterwards.
> In order to reduce the use of cycles, what is the recommended approach?
> Thank you.

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

View raw message