hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bharathi swarajya" <ssbharath...@rediffmail.com>
Subject Re: RE: Does HttpClient create connections on fly
Date Sun, 18 Dec 2005 03:57:12 GMT
Hi Steve,

  But how do i know what are the values to be set. The no of threads launching is not controlled
by us. It might be 150 or more. But how do i decide the max no connections for host and total
connections. That is, which one is faster, running the same with lesser no of connections
in pool or having 150 in the connection   pool.

I also want the clarifictaion if the connections are being reused. I checked with the netstat
command and i dont find it happening. Doesnt this increase overhead. We want the response
back in 3 secs,but if the aplication connectivity itself is taking 1 minute then it is a big

Could you help me further on this.

On Fri, 16 Dec 2005 Steven Terrell wrote :
>    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
>   _____
> 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.
>S.S. Bharathi

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