于 2010-12-28 17:03, Oleg Kalnichevski 写道:
On Tue, 2010-12-28 at 16:33 +0800, 世涛 wrote:
Hi all:

I'm considering to update HttpClient3.1 to HttpClient4.0.3 in my new project, 
and I must be sure that system speed will not be slower.
So I did some tests, but I found that Httpclient4's performance is not as good 
as HttpClient3.1.

In my test, I use two Linux servers(A and B, both 8-core CPU, 1.5G memory) in 
the same LAN.
There is Apache2.2 installed on Server-B, and Server-B acts as a static web 
server.
And Server-A runs test programs based on HttpClient, the test is to finish 1000 
requests to Server-B sequentially.

Surprisingly, the time that HttpClient4.0.3 used is almost twice as 
HttpClient3.1.

My test-code is very simple, just the basic classes and methods.

Anybody has ever done the similar test before? Is the result normal or I did 
some thing wrong? 3x!

------
Best regards,
stone

(1) 1000 requests is simply not enough to draw any meaningful conclusion
about performance of an HTTP client.

(2) Make sure to turn off the stale connection check, which has a major
performance impact on small requests

In my tests HttpClient 4.x turns out to be 30% to 200% faster than
HttpClient 3.1 depending on the number of concurrent execution threads

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

You can find the source code of the benchmark here. Feel free to run it
against your servers to see if you get similar results

http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient-benchmark/

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Thanks very much for your quick reply!

I just did the benchmark test from your email, in the benchmark, the
number of requests was 10000, but the result seems not satisfying.
The result data is below:

[zhangshi...@inc-130-120 http-benchmark]$ ./httpclient4.sh
http://10.20.130.119/100k.txt 10000
Server Software:        Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8o

Document URI:           http://10.20.130.119/100k.txt
Document Length:        100000 bytes

Time taken for tests:   30.528 seconds
Complete requests:      10000
Failed requests:        0
Content transferred:    1000000000 bytes
Requests per second:    327.56815 [#/sec] (mean)
Time per request:       3.0528 [ms] (mean)
[zhangshi...@inc-130-120 http-benchmark]$ ./httpclient3.sh
http://10.20.130.119/100k.txt 10000
Server Software:        Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8o

Document URI:           http://10.20.130.119/100k.txt
Document Length:        100000 bytes

Time taken for tests:   25.333 seconds
Complete requests:      10000
Failed requests:        0
Content transferred:    1000000000 bytes
Requests per second:    394.74203 [#/sec] (mean)
Time per request:       2.5333 [ms] (mean)

--
ASC-北京研发部-应用工程部
张世涛
分机号:73354
旺旺:stonecheung2010


________________________________

This email (including any attachments) is confidential and may be legally 
privileged. If you received this email in error, please delete it immediately 
and do not copy it or use it for any purpose or disclose its contents to any 
other person. Thank you.

本电邮(包括任何附件)可能含有机密资料并受法律保护。如您不是正确的收件人,请您立即删除本邮件。请不要将本电邮进行复制并用作任何其他用途、或透露本邮件之内容。谢谢。

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to