hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Speirs <bill.spe...@gmail.com>
Subject Re: HttpClient Performance Issues
Date Fri, 15 Jul 2011 15:27:49 GMT
Digging a bit deeper. I captured the execute time for JRE, Client4,
and Netty and made the following graph. As can be clearly seen, both
JRE and Client4 spend all of their time (sometimes as long as 6
seconds) on the initial 100 requests (or one per thread). Whereas
Netty is flat across all requests. (Also, it doesn't look like Netty
runs concurrently.)

What is the up-front costs for Client4? How can I off-load that time?

Thanks...

Bill-

On Fri, Jul 15, 2011 at 10:03 AM, Bill Speirs <bill.speirs@gmail.com> wrote:
> I am having performance issues with the HttpClient. I first noticed
> these issues in my own code, but they are repeatable in the
> httpclient-benchmark code as well.
>
> I have an httpd server setup with a 45 byte static page on a machine
> on the same network leg as the machine making the requests. When I run
> ab against this server I get the following:
>
> Concurrency Level:      100
> Time taken for tests:   0.175542 seconds
> Complete requests:      1000
> Failed requests:        0
> Write errors:           0
> Total transferred:      283000 bytes
> HTML transferred:       45000 bytes
> Requests per second:    5696.64 [#/sec] (mean)
> Time per request:       17.554 [ms] (mean)
> Time per request:       0.176 [ms] (mean, across all concurrent requests)
> Transfer rate:          1572.27 [Kbytes/sec] received
>
> When I run the benchmark (compiling just TestHttpClient4.java) against
> this server I get the following:
>
> Concurrency level:      100
> Time taken for tests:   6.906 seconds
> Complete requests:      1000
> Failed requests:        0
> Content transferred:    45000 bytes
> Requests per second:    144.80162 [#/sec] (mean)
>
> I can understand that ab might be a bit faster than HttpClient, but
> going from 5K requests per second to 150 requests per second is MUCH
> slower.
>
> I wrapped the HttpResponse response = httpclient.execute(request);
> line with calls to System.currentTimeMillis(); and then printed the
> time for the execute() function. Most of the calls are 0 - 3ms;
> however there are some calls to execute() that are as high as 6,900ms!
>
> What could be taking almost 6 seconds to make the request? Is this the
> garbage collector pausing the test?
>
> Thoughts?
>
> Environment:
>
> java version "1.6.0_26"
> Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
> Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
>
> Bill-
>


Mime
View raw message