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 Joan Balagueró <jo...@grupoventus.com> on 2007/04/23 16:45:40 UTC

QUESTION ABOUT MULTITHREADED HTTP CONNECTION MANAGER

Hello,

 

I’m using a MHCM with httpClient 3.0.

 

If I don’t set the maxTotalConnections and the connectionManagerTimeout for
my instance of MHCM, what values are used?

 

The reason for this question is the following: I have an application in
production mode that was working perfectly for months. Now there are more
requests per second, and sometimes requests that took 50ms before, now take
more than 10 seconds.

 

It seems that when my application receives the request, the pool is full and
it has to wait for “x” milliseconds before a connection is available.

 

 

Thanks,

 

Joan.

 

 


RE: QUESTION ABOUT MULTITHREADED HTTP CONNECTION MANAGER

Posted by Roland Weber <RO...@de.ibm.com>.
Joan Balagueró <jo...@grupoventus.com> wrote on 23.04.2007 
18:12:20:

> But the question is: if I set "maxConnectionsPerHost" to a unlimited 
value,
> but I DON'T SET the maxTotalConnections (so the used value is the 
default
> value, that's 20), then my MHCM has a maximum number of connections to 
20
> ???

Yes. That's what "total" means: never more than that.

cheers,
  Roland

RE: QUESTION ABOUT MULTITHREADED HTTP CONNECTION MANAGER

Posted by Joan Balagueró <jo...@grupoventus.com>.
Hello Roland,

I have a MHCM instance per host (If I have 5 hosts, I have 5 MHCM, one per
host).

The configuration is always the same:

HttpClient objHttp = new HttpClient(new
MultiThreadedHttpConnectionManager());
objHttp.getHttpConnectionManager().getParams().setMaxConnectionsPerHost(Host
Configuration.ANY_HOST_CONFIGURATION, Integer.MAX_VALUE);


But the question is: if I set "maxConnectionsPerHost" to a unlimited value,
but I DON'T SET the maxTotalConnections (so the used value is the default
value, that's 20), then my MHCM has a maximum number of connections to 20
???

Thanks a lot,

Joan.









-----Mensaje original-----
De: Roland Weber [mailto:ROLWEBER@de.ibm.com] 
Enviado el: lunes, 23 de abril de 2007 17:05
Para: HttpClient User Discussion
Asunto: Re: QUESTION ABOUT MULTITHREADED HTTP CONNECTION MANAGER

Hello Joan,

have a look at the Threading Guide:
http://jakarta.apache.org/commons/httpclient/threading.html

I think the default for the timeout is "no timeout".
You can look it up somewhere in the client parameters:
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/http
client/params/HttpClientParams.html#CONNECTION_MANAGER_TIMEOUT


hope that helps,
  Roland






Hello,

I’m using a MHCM with httpClient 3.0.

If I don’t set the maxTotalConnections and the connectionManagerTimeout for
my instance of MHCM, what values are used?

The reason for this question is the following: I have an application in
production mode that was working perfectly for months. Now there are more
requests per second, and sometimes requests that took 50ms before, now take
more than 10 seconds.

It seems that when my application receives the request, the pool is full and
it has to wait for “x” milliseconds before a connection is available.

Thanks,

Joan.


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


Re: QUESTION ABOUT MULTITHREADED HTTP CONNECTION MANAGER

Posted by Roland Weber <RO...@de.ibm.com>.
Hello Joan,

have a look at the Threading Guide:
http://jakarta.apache.org/commons/httpclient/threading.html

I think the default for the timeout is "no timeout".
You can look it up somewhere in the client parameters:
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/params/HttpClientParams.html#CONNECTION_MANAGER_TIMEOUT


hope that helps,
  Roland