You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Karthik K <ka...@gmail.com> on 2010/06/28 12:07:27 UTC
Number of HTTP connections are increasing rapidly
Hi,
I am working on an application where 20 threads opens,works on,closes a http
connection. But when i do netstat -p | grep <my pid> | grep ESTABLISHED | wc
-l , the number is increasing rapidly upto 1200. Please help.
kaka
Re: Number of HTTP connections are increasing rapidly
Posted by Karthik K <ka...@gmail.com>.
On Wed, Jun 30, 2010 at 6:04 AM, Sam Crawford <sa...@gmail.com> wrote:
> Two suggestions (assuming you're on version 4.x):
>
> 1) Enable logging for your application and post what logs you can
> here. Enabling logging is described on
> http://hc.apache.org/httpcomponents-client-4.0.1/logging.html. For
> your issue, I'd suggest the "connection management" logging approach
> may be the most appropriate.
> 2) Check that whenever you're fetching data from a remote web server
> you're either reading the InputStream from the entity completely or
> are calling entity.consumeContent(). If you do not do this, the
> connection will not be closed.
>
> Thanks,
>
> Sam
>
>
> Thanks Sam, i was not reading the stream, fixed it now :)
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>
Re: Number of HTTP connections are increasing rapidly
Posted by Sam Crawford <sa...@gmail.com>.
Two suggestions (assuming you're on version 4.x):
1) Enable logging for your application and post what logs you can
here. Enabling logging is described on
http://hc.apache.org/httpcomponents-client-4.0.1/logging.html. For
your issue, I'd suggest the "connection management" logging approach
may be the most appropriate.
2) Check that whenever you're fetching data from a remote web server
you're either reading the InputStream from the entity completely or
are calling entity.consumeContent(). If you do not do this, the
connection will not be closed.
Thanks,
Sam
On 28 June 2010 11:07, Karthik K <ka...@gmail.com> wrote:
> Hi,
> I am working on an application where 20 threads opens,works on,closes a http
> connection. But when i do netstat -p | grep <my pid> | grep ESTABLISHED | wc
> -l , the number is increasing rapidly upto 1200. Please help.
>
> kaka
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org