hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Silvia, Don" <Don.Sil...@FMR.com>
Subject RE: How to measure response time with MultiThreadedHttpConnectionManager?
Date Fri, 21 Apr 2006 17:58:56 GMT
Roland,

>If threads get interrupted, you'd see InterruptedException 
>traces somewhere.

I think I meant the thread is blocked, I'm not seeing any
InterruptedExceptions.

>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.

I have multiple hosts, with multiple requests to each.  I'm setting both
setMaxTotalConnections() and setMaxConnectionsPerHost() to the total
number of URLs, so I think max connections per host is higher than it
really needs to be.

>>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.

I do think I only have one connection per thread, because I'm following
the MultiThreadedExample at
http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/httpclient/bran
ches/HTTPCLIENT_2_0_BRANCH/src/examples/MultiThreadedExample.java?view=m
arkup which starts one thread per URL.  Are you saying that's not a good
practice?  If so, can you give me any guidance on the best ratio of
threads to connections?

Thanks,

Don

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


Mime
View raw message