Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 99176 invoked from network); 18 Dec 2005 03:57:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Dec 2005 03:57:41 -0000 Received: (qmail 23340 invoked by uid 500); 18 Dec 2005 03:57:41 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 23325 invoked by uid 500); 18 Dec 2005 03:57:40 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 23314 invoked by uid 99); 18 Dec 2005 03:57:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Dec 2005 19:57:40 -0800 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,MAILTO_TO_SPAM_ADDR,MSGID_FROM_MTA_HEADER X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [203.199.83.33] (HELO rediffmail.com) (203.199.83.33) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 17 Dec 2005 19:57:39 -0800 Received: (qmail 11266 invoked by uid 510); 18 Dec 2005 03:57:13 -0000 Date: 18 Dec 2005 03:57:12 -0000 Message-ID: <20051218035712.11265.qmail@webmail47.rediffmail.com> Received: from unknown (203.31.24.51) by rediffmail.com via HTTP; 18 dec 2005 03:57:12 -0000 MIME-Version: 1.0 From: "bharathi swarajya" Reply-To: "bharathi swarajya" To: "HttpClient User Discussion" Cc: "Steven Terrell" Subject: Re: RE: Does HttpClient create connections on fly Content-type: multipart/alternative; boundary="Next_1134878232---0-203.199.83.33-11260" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --Next_1134878232---0-203.199.83.33-11260 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Steve,=0A=0A 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 ho= w do i decide the max no connections for host and total connections. That i= s, which one is faster, running the same with lesser no of connections in p= ool or having 150 in the connection =A0pool.=0A=0AI also want the clarific= taion if the connections are being reused. I checked with the netstat comma= nd 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 takin= g 1 minute then it is a big problem.=0A=0ACould you help me further on this= .=0A=0AOn Fri, 16 Dec 2005 Steven Terrell wrote :=0A>Bharathi,=0A>=0A> I= f you keep increasing the number of threads, you're just increasing the=0A>= amount of overhead JVM has to do to manage those threads. That's why your= =0A>150 thread test performs better than your 500 thread test. My applicati= on,=0A>running on a dual processor machine, works best with 80 threads.=0A>= =0A> I am using the MultiThreadedHttpConnectionManager with thread pooli= ng.=0A>Make sure you are using HttpConnectionManagerParams, and you are cal= ling=0A>these methods:=0A>=0A> setMaxConnectionsPerHost=0A>=0A> setDe= faultMaxConnectionsPerHost=0A>=0A> setMaxTotalConnections=0A>=0A>=0A>=0A= > I have no problems with connection pooling. I would suggest you look a= t=0A>the server being called, and insure that the server is not closing the= =0A>connections.=0A>=0A>=0A>=0A>--Steve=0A>=0A> _____=0A>=0A> From: bhara= thi swarajya [mailto:ssbharathi71@rediffmail.com]=0A>Sent: Thursday, Decemb= er 15, 2005 11:11 PM=0A>To: httpclient-user@jakarta.apache.org=0A>Subject: = Does HttpClient create connections on fly=0A>=0A>=0A>=0A>=0A>I require an i= mportant information regarding Commons Http Client. I am=0A>working in a pr= oject where we launch 4 to 5 threads from a page and then=0A>each thread wi= ll be connecting to a server machine where all the threads=0A>connect to th= e same port. The peak load of users accessing might be 60 to=0A>80. So at a= time 240-320 threads might be launched. We don't want to=0A>recreate conne= ctions, but want a pooling mechanisms where connection wont be=0A>closed an= d can be used by the subsequent threads. I was running a test class=0A>usin= g MultiThreadedHttpConnectionManager class and HtppClient. but when I=0A>wa= s verifying the no of connections on the server all were established and I= =0A>found that the connections were not getting reused. We need a response = for=0A>each thread with in 2 -3 secs. So I tried a sample code where each t= hread=0A>sleeps for the same amount of time i.e 3 seconds and found that 5= 00 threads=0A>took 3 minutes and 150 threads took 34 seconds. Could you ple= ase suggest us=0A>how to proceed further and does HttpClient supports pooli= ng. Also does it=0A>create connections on fly. How are the connections crea= ted.I am also=0A>attaching the sample code which I tried. Could any one ple= ase guide further=0A>on this.=0A>=0A>=0A>Thanks=0A>S.S. Bharathi=0A>=0A>=0A= >=0A>=0A>ture-home.htm/1507191490@Middle5?PARTNER=3D3>=0A>=0A --Next_1134878232---0-203.199.83.33-11260--