hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Terrell <Steven.Terr...@guideworkstv.com>
Subject RE: Does HttpClient create connections on fly
Date Fri, 16 Dec 2005 15:08:59 GMT
Bharathi,

   If you keep increasing the number of threads, you're just increasing the
amount of overhead JVM has to do to manage those threads. That's why your
150 thread test performs better than your 500 thread test. My application,
running on a dual processor machine, works best with 80 threads.

   I am using the MultiThreadedHttpConnectionManager with thread pooling.
Make sure you are using HttpConnectionManagerParams, and you are calling
these methods: 

   setMaxConnectionsPerHost

   setDefaultMaxConnectionsPerHost

   setMaxTotalConnections

 

   I have no problems with connection pooling. I would suggest you look at
the server being called, and insure that the server is not closing the
connections.

 

--Steve

  _____  

From: bharathi swarajya [mailto:ssbharathi71@rediffmail.com] 
Sent: Thursday, December 15, 2005 11:11 PM
To: httpclient-user@jakarta.apache.org
Subject: Does HttpClient create connections on fly

 

  
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



 
<http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signa
ture-home.htm/1507191490@Middle5?PARTNER=3> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message