You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Oleg Kalnichevski <ol...@apache.org> on 2006/03/27 23:29:23 UTC

[HttpComponents] HttpCore vs HttpClient 3.0; performance bechmarks

Based on my (rather limited) tests HttpCore appears approximately 35% to
18% faster than HttpClient 3.0 depending on the document length. Memory
footprint is much more difficult to quantify. Nonetheless, evidently
HttpCore appears to require 2.5 times less GC sweeps for the same unit
of work. 

I'd love to hear if others can reproduce similar performance gains for
their respective platforms. Please note, though, test results can be
easily distorted by the HTTP server configuration (logging, connection
keep-alive, etc)

Benchmarking tools can be found here:
http://svn.apache.org/repos/asf/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/
http://svn.apache.org/repos/asf/jakarta/httpcomponents/trunk/http-core/src/contrib/org/apache/http/contrib/benchmark/

Oleg


Test results
==============
Test platform:
--------------
Ubuntu Linux 2.6.12-10-686
2GB RAM
Apache HTTPD 2.0.54-5ubuntu4 (KeepAlive On; MaxKeepAliveRequests 0)
SUN JRE, Standard Edition (build 1.5.0_06-b05)

HttpClient 3.0 (HTTP GET 52 bytes; 200,000 repetitions)
----------
oleg@dld810:~/src/apache.org/jakarta/commons-httpclient
$ /opt/sun-jdk-1.5.0/bin/java -cp
bin:/opt/libjava/commons-cli.jar:lib/commons-codec.jar:lib/commons-logging.jar org.apache.commons.httpclient.contrib.benchmark.HttpBenchmark -k -n 200000 http://localhost/apache2-default/hello.html
Server Software:        Apache/2.0.54 (Ubuntu) mod_ssl/2.0.54
OpenSSL/0.9.7g
Server Hostname:        localhost
Server Port:            80

Document Path:          /apache2-default/hello.html
Document Length:        52 bytes

Time taken for tests:   32.019 seconds
Complete requests:      200000
Failed requests:        0
Content transferred:    10400000 bytes
Requests per second:    6246.291 [#/sec] (mean)
Time per request:       0.160095 [ms] (mean)

HttpCore 2005-03-27 (HTTP GET 52 bytes; 200,000 repetitions)
----------
oleg@dld810:~/src/apache.org/jakarta/httpcomponents/http-core
$ /opt/sun-jdk-1.5.0/bin/java -cp bin:/opt/libjava/commons-cli.jar
org.apache.http.contrib.benchmark.HttpBenchmark -k -n 200000
http://localhost/apache2-default/hello.html
Server Software:        Apache/2.0.54 (Ubuntu) mod_ssl/2.0.54
OpenSSL/0.9.7g
Server Hostname:        localhost
Server Port:            80

Document Path:          /apache2-default/hello.html
Document Length:        52 bytes

Time taken for tests:   20.862 seconds
Complete requests:      200000
Failed requests:        0
Content transferred:    10400000 bytes
Requests per second:    9586.809 [#/sec] (mean)
Time per request:       0.10431 [ms] (mean)

HttpClient 3.0 (HTTP GET 21353 bytes; 200,000 repetitions)
----------
oleg@dld810:~/src/apache.org/jakarta/commons-httpclient
$ /opt/sun-jdk-1.5.0/bin/java -cp
bin:/opt/libjava/commons-cli.jar:lib/commons-codec.jar:lib/commons-logging.jar org.apache.commons.httpclient.contrib.benchmark.HttpBenchmark -k -n 200000 http://localhost/manual/install.html 
Server Software:        Apache/2.0.54 (Ubuntu) mod_ssl/2.0.54
OpenSSL/0.9.7g
Server Hostname:        localhost
Server Port:            80

Document Path:          /manual/install.html
Document Length:        21353 bytes

Time taken for tests:   61.263 seconds
Complete requests:      200000
Failed requests:        0
Content transferred:    4270600000 bytes
Requests per second:    3264.6133 [#/sec] (mean)
Time per request:       0.306315 [ms] (mean)

HttpCore 2005-03-27 (HTTP GET 21353 bytes; 200,000 repetitions)
----------
oleg@dld810:~/src/apache.org/jakarta/httpcomponents/http-core
$ /opt/sun-jdk-1.5.0/bin/java -cp bin:/opt/libjava/commons-cli.jar
org.apache.http.contrib.benchmark.HttpBenchmark -k -n 200000
http://localhost/manual/install.html
Server Software:        Apache/2.0.54 (Ubuntu) mod_ssl/2.0.54
OpenSSL/0.9.7g
Server Hostname:        localhost
Server Port:            80

Document Path:          /manual/install.html
Document Length:        21353 bytes

Time taken for tests:   51.746 seconds
Complete requests:      200000
Failed requests:        0
Content transferred:    4270600000 bytes
Requests per second:    3865.0332 [#/sec] (mean)
Time per request:       0.25873 [ms] (mean)

HttpClient 3.0 (HTTP GET 21353 bytes; 1,000 repetitions; GC logging)
----------
oleg@dld810:~/src/apache.org/jakarta/commons-httpclient
$ /opt/sun-jdk-1.5.0/bin/java -Xloggc:log.txt -cp
bin:/opt/libjava/commons-cli.jar:lib/c
ommons-codec.jar:lib/commons-logging.jar
org.apache.commons.httpclient.contrib.benchmark.HttpBenchmark -k -n 1000
http://localhost/manual/insta ll.html
Server Software:        Apache/2.0.54 (Ubuntu) mod_ssl/2.0.54
OpenSSL/0.9.7g
Server Hostname:        localhost
Server Port:            80

Document Path:          /manual/install.html
Document Length:        21353 bytes

Time taken for tests:   0.668 seconds
Complete requests:      1000
Failed requests:        0
Content transferred:    21353000 bytes
Requests per second:    1497.006 [#/sec] (mean)
Time per request:       0.668 [ms] (mean)

0.000: [GC 512K->140K(1984K), 0.0027130 secs] 
0.037: [GC 652K->175K(1984K), 0.0021980 secs]
0.082: [GC 687K->194K(1984K), 0.0022870 secs]
0.144: [GC 706K->208K(1984K), 0.0020230 secs]
0.192: [GC 720K->207K(1984K), 0.0008830 secs]
0.232: [GC 719K->206K(1984K), 0.0006200 secs]
0.274: [GC 718K->207K(1984K), 0.0007660 secs]
0.303: [GC 719K->206K(1984K), 0.0004460 secs]
0.332: [GC 718K->207K(1984K), 0.0004570 secs]
0.353: [GC 719K->205K(1984K), 0.0004160 secs]
0.374: [GC 717K->207K(1984K), 0.0004180 secs]
0.403: [GC 719K->205K(1984K), 0.0004480 secs]
0.426: [GC 717K->207K(1984K), 0.0004570 secs]
0.452: [GC 719K->205K(1984K), 0.0004310 secs]
0.471: [GC 717K->207K(1984K), 0.0004020 secs]
0.494: [GC 719K->207K(1984K), 0.0005630 secs]
0.516: [GC 719K->207K(1984K), 0.0004470 secs]
0.535: [GC 719K->207K(1984K), 0.0005850 secs]
0.554: [GC 719K->207K(1984K), 0.0004220 secs]
0.573: [GC 719K->207K(1984K), 0.0003430 secs]
0.592: [GC 719K->207K(1984K), 0.0002190 secs]
0.610: [GC 719K->207K(1984K), 0.0003380 secs]
0.649: [GC 719K->207K(1984K), 0.0003270 secs]
0.667: [GC 719K->207K(1984K), 0.0002600 secs]
0.686: [GC 719K->206K(1984K), 0.0002340 secs]
0.704: [GC 718K->207K(1984K), 0.0003080 secs]
0.723: [GC 719K->206K(1984K), 0.0002250 secs]
0.740: [GC 718K->207K(1984K), 0.0006790 secs]

HttpCore 2005-03-27 (HTTP GET 21353 bytes; 1,000 repetitions; GC
logging)
----------
oleg@dld810:~/src/apache.org/jakarta/httpcomponents/http-core
$ /opt/sun-jdk-1.5.0/bin/java -Xloggc:log.txt -cp
bin:/opt/libjava/commons-cli.jar
org.apache.http.contrib.benchmark.HttpBenchmark -k -n 1000
http://localhost/manual/install.html
Server Software:        Apache/2.0.54 (Ubuntu) mod_ssl/2.0.54
OpenSSL/0.9.7g
Server Hostname:        localhost
Server Port:            80

Document Path:          /manual/install.html
Document Length:        21353 bytes

Time taken for tests:   0.456 seconds
Complete requests:      1000
Failed requests:        0
Content transferred:    21353000 bytes
Requests per second:    2192.9824 [#/sec] (mean)
Time per request:       0.456 [ms] (mean)

0.000: [GC 512K->144K(1984K), 0.0029120 secs]
0.044: [GC 656K->152K(1984K), 0.0031770 secs]
0.104: [GC 664K->285K(1984K), 0.0014030 secs]
0.165: [GC 797K->285K(1984K), 0.0004850 secs]
0.215: [GC 797K->288K(1984K), 0.0002940 secs]
0.266: [GC 800K->287K(1984K), 0.0002410 secs]
0.315: [GC 799K->287K(1984K), 0.0002420 secs]
0.357: [GC 799K->286K(1984K), 0.0002190 secs]
0.413: [GC 798K->286K(1984K), 0.0002750 secs]
0.454: [GC 798K->285K(1984K), 0.0002160 secs]
0.494: [GC 797K->281K(1984K), 0.0008180 secs]



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