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]
