hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bharathi swarajya" <ssbharath...@rediffmail.com>
Subject Does HttpClient create connections on fly
Date Fri, 16 Dec 2005 04:10:41 GMT
  
 I require an important information regarding Commons Http Client. I am working in a project
where we launch 4 to 5 threads from a page and then each thread will be connecting to a server
machine where all the threads connect to the same port. The peak load of users accessing might
be 60 to 80. So at a time 240-320 threads might be launched. We don't want to recreate connections,
but want a pooling mechanisms where connection wont be closed and can be used by the subsequent
threads. I was running a test class using MultiThreadedHttpConnectionManager class and HtppClient.
but when I was verifying the no of connections on the server all were established and I found
that the connections were not getting reused. We need a response for each thread with in 2
-3 secs. So I tried a sample code where each thread sleeps for the same amount of time i.e
3 seconds  and found that 500 threads took 3 minutes and 150 threads took 34 seconds. Could
you please suggest us how to proceed further and does HttpClient supports pooling. Also does
it create connections on fly. How are the connections created.I am also attaching the sample
code which I tried. Could any one please guide further on this.


Thanks
S.S. Bharathi

Mime
View raw message