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 monmohan <mo...@gmail.com> on 2009/11/12 03:36:18 UTC

httpclient and mulitthreaded connection manager

I need to implement a scenario where a http request is sent to the same host
by multiple threads and requires login but the login credentials are always
same. In order to avoid logging in all the time I am planning to use a
single instance of HTTPClient with a multithreaded connection manager.
However, while testing I ran into scenarios where different threads were
waiting infinitely for a connection. This seems to happen when the number of
threads is close to the maximum number of connections set up for the
connection manager. In general what is the connection pooling strategy for
this connection manager? Does the pool grow in size as the number of
simultaneous requests are greater than the configured pool size? Is there an
alternate way to achieve what I am trying to do?
regards
Monmohan
-- 
View this message in context: http://old.nabble.com/httpclient-and-mulitthreaded-connection-manager-tp26312457p26312457.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: httpclient and mulitthreaded connection manager

Posted by Oleg Kalnichevski <ol...@apache.org>.
monmohan wrote:
> thanks for the response.
> I have observed that whenever the number of simultaneous threads is close to
> the max limit, the threads go to infinite waiting state. Is this a known
> issue? 

HttpClient 3.x is not known to have such an issue. Most likely your 
application code leaks connections by failing to release them back to 
the pool.

Oleg


I am running on Ubuntu Linux, sun jdk 1.5, http client 3.0.1
> 
> regards
> Monmohan
>   
> 
> olegk wrote:
>> On Wed, 2009-11-11 at 18:36 -0800, monmohan wrote:
>>> I need to implement a scenario where a http request is sent to the same
>>> host
>>> by multiple threads and requires login but the login credentials are
>>> always
>>> same. In order to avoid logging in all the time I am planning to use a
>>> single instance of HTTPClient with a multithreaded connection manager.
>>> However, while testing I ran into scenarios where different threads were
>>> waiting infinitely for a connection. This seems to happen when the number
>>> of
>>> threads is close to the maximum number of connections set up for the
>>> connection manager. In general what is the connection pooling strategy
>>> for
>>> this connection manager? Does the pool grow in size as the number of
>>> simultaneous requests are greater than the configured pool size?
>> No, it does not. The connection pool will not grow beyond the max limit.
>> This is the whole point of having a max limit in the first place.
>>
>> Oleg
>>
>>
>>>  Is there an
>>> alternate way to achieve what I am trying to do?
>>> regards
>>> Monmohan
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: httpclient and mulitthreaded connection manager

Posted by monmohan <mo...@gmail.com>.
thanks for the response.
I have observed that whenever the number of simultaneous threads is close to
the max limit, the threads go to infinite waiting state. Is this a known
issue? I am running on Ubuntu Linux, sun jdk 1.5, http client 3.0.1

regards
Monmohan
  

olegk wrote:
> 
> On Wed, 2009-11-11 at 18:36 -0800, monmohan wrote:
>> I need to implement a scenario where a http request is sent to the same
>> host
>> by multiple threads and requires login but the login credentials are
>> always
>> same. In order to avoid logging in all the time I am planning to use a
>> single instance of HTTPClient with a multithreaded connection manager.
>> However, while testing I ran into scenarios where different threads were
>> waiting infinitely for a connection. This seems to happen when the number
>> of
>> threads is close to the maximum number of connections set up for the
>> connection manager. In general what is the connection pooling strategy
>> for
>> this connection manager? Does the pool grow in size as the number of
>> simultaneous requests are greater than the configured pool size?
> 
> No, it does not. The connection pool will not grow beyond the max limit.
> This is the whole point of having a max limit in the first place.
> 
> Oleg
> 
> 
>>  Is there an
>> alternate way to achieve what I am trying to do?
>> regards
>> Monmohan
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/httpclient-and-mulitthreaded-connection-manager-tp26312457p26318632.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: httpclient and mulitthreaded connection manager

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2009-11-11 at 18:36 -0800, monmohan wrote:
> I need to implement a scenario where a http request is sent to the same host
> by multiple threads and requires login but the login credentials are always
> same. In order to avoid logging in all the time I am planning to use a
> single instance of HTTPClient with a multithreaded connection manager.
> However, while testing I ran into scenarios where different threads were
> waiting infinitely for a connection. This seems to happen when the number of
> threads is close to the maximum number of connections set up for the
> connection manager. In general what is the connection pooling strategy for
> this connection manager? Does the pool grow in size as the number of
> simultaneous requests are greater than the configured pool size?

No, it does not. The connection pool will not grow beyond the max limit.
This is the whole point of having a max limit in the first place.

Oleg


>  Is there an
> alternate way to achieve what I am trying to do?
> regards
> Monmohan



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org