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- --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
