hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <http-as...@dubioso.net>
Subject Re: How to measure response time with MultiThreadedHttpConnectionManager?
Date Fri, 21 Apr 2006 17:08:57 GMT
Hello Don,

>     long startTime = System.currentTimeMillis();
>     client.executeMethod(method);  // method is a PostMethod
>     long elapsed = System.currentTimeMillis() - startTime;

I don't see what should be wrong with this approach.
> But what I'm seeing is that the threads all start up and mark the start
> time, then the threads appear to be interrupted during executeMethod.
> The result is that the measured times get progressively longer, with the
> last thread to finish reporting a time almost as long as the entire
> application's run time.

If threads get interrupted, you'd see InterruptedException traces somewhere.
If threads get blocked, you have to look for the reason of the blocking.
For example, if all your requests go to the same host, then the default
value for "max connections per host" will be too low. All threads will
take turns in using (I think) two connections.

>From what you describe, I would say that your measuring is correct
and the bad response times you determine are the result of a badly
configured connection manager. If the response times of the last
threads are almost the runtime of the whole application, I suspect
that each thread only executes one request. You should consider to
have each thread execute several requests.


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

View raw message