On Wed, 2013-07-10 at 13:49 +0000, Dave Johnston wrote: > Hi, > I've been trying to execute a large volume of transactions to simulate real > traffic using the httpclient. I'm trying to create 1000 concurrent > connections, that each perform 10 requests per second. i.e. 10000 > transactions per second. > > I've based my code on the multi-threaded example: > http://hc.apache.org/httpcomponents-client-ga/httpclient/examples/org/apache/http/examples/client/ClientMultiThreadedExecution.java > > I've increased the number of connections allowed per route to 1000 and have > attempted to measure latency by doing this: > > long currentTime = System.currentTimeMillis(); > HttpResponse response = httpClient.execute(httpget, context); > long executionTime = System.currentTimeMillis(); > > System.out.printf("ID [%d] Executed in %d milliseconds\n", id, > (executionTime-currentTime)); > > It looks like the latency increases as the number of connections go up, > although I would have hoped to see it stay the same (I've used other load > test tools to execute 20K transactions with steady latency). > > Whats the best approach for writing an application that behaves this way? Is > the standard PoolingClientConnectionManager with multiple threads the way to > go? >
Dave, If you are _absolutely_ sure you need to have 1000 concurrent connections, you might be better served by the async version of Apache HttpClient http://hc.apache.org/httpcomponents-asyncclient-dev/index.html Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
