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:49:37 GMT
Hi Jaya,

  Thanks for your response. We will use only one httpConnection and MultiThreadedConnection
manager for the total application. But inorder that all the threads in case 160 are launched
at the same time, get back the response in 3 seconds, do i need to add any thing extra in
code by making the connection persistent. The production boxes have 8 cpus. I need the values
to be set for the maximum connections per host.   I alos need a clarifictaion do i need i
need to add any thing extra for pooling and closing the connection. In the test i did i find
the connections are not being reused at all. Then it incurs a lot of overhead. Could you please
clarify on the same.


On Fri, 16 Dec 2005 Jaya Christina B wrote :
>
>Bharathi,
>I think you should use MultiThreadedHttpConnectionManager  & should
>create ONE httpClient object for your entire application.
>Pooling will be managed by MultiThreadedHttpConnectionManager  .
>
>Creating on httpClient  for every request can be disastrous... I learnt
>the heard way...
>It cud soon result in out of memory error. So, do reuse the HttpClient.
>
>HTH
>
>Regards,
>Jaya.
>
>
>
>________________________________
>
> From: bharathi swarajya [mailto:ssbharathi71@rediffmail.com]
>Sent: Friday, December 16, 2005 9:41 AM
>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
>
>*********************************************************
>Disclaimer:
>
>The contents of this E-mail (including the contents of the enclosure(s) or attachment(s)
if any) are privileged and confidential material of MBT and should not be disclosed to, used
by or copied in any manner by anyone other than the intended addressee(s).   In case you are
not the desired addressee, you should delete this message and/or re-direct it to the sender.
 The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if
any) are those of the individual sender, except where the sender expressly, and with authority,
states them to be the views of MBT.
>
>This e-mail message including attachment/(s), if any, is believed to be free of any virus.
 However, it is the responsibility of the recipient to ensure that it is virus free and MBT
is not responsible for any loss or damage arising in any way from its use
>
>*********************************************************

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