You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by TP...@behr.com on 2004/03/31 20:27:12 UTC

Setting maxTotalConnections and maxHostConnections

Hello.

We have a firewall, load balancer, 4 web servers, 6 app servers, 2 
database servers, and 2 specialty web servers/app servers on our 
production environment.  We average 20,000 users a day.  We are expecting 
to get North of 100,000 users a day once our marketing campaign launches.

The specialty boxes are used to do search and dynamic coloring of images. 
We use the dynamic coloring to allow our customers to paint rooms online. 
We are using httpclient on the app servers to request resources from the 
web servers and the dynamic coloring servers.  We transform all the 
resources into a Flash movie.

The application used to request the resources and do the transformation is 
third party.  The maxTotalConnections and maxHostConnections used to be 
set at 20 on that application.  We have been recommended by the vendor to 
change that setting to 1000.  That is a significant change.  So, my 
question is is there any formula or rule of thumb that can be used to set 
that number taking into factors such as load, setup, other settings, etc.

Thank you for any help you can provide.

Thinh

Re: Setting maxTotalConnections and maxHostConnections

Posted by Michael Becke <be...@u.washington.edu>.
Hi Thinh,

There were also some improvements made to the 
MultiThreadedHttpConnectionManager I believe.

Mike

On Apr 1, 2004, at 4:22 PM, Oleg Kalnichevski wrote:

> Thinh,
> There have been a few important fixes primarily in the authentication
> code. I do recommend upgrading.
>
> There has been no API changes since 2.0-beta2 if my memory does not 
> fail
> me. So you should be able to drop in the final release in place of RC1
>
> Oleg
>
> On Thu, 2004-04-01 at 21:15, TPhannguyen@behr.com wrote:
>> What happens when maxTotalConnections is hit?  Do all subsequent 
>> requests
>> get queued?  What happens when maxHostConnections is hit?
>>
>> We are currently running RC1.  Should we upgrade to the final release?
>> Reading the notes, it seems like the release just has bug fixes and 
>> should
>> work in place of RC1.
>>
>> Thanks,
>> Thinh
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> commons-httpclient-dev-help@jakarta.apache.org
>


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


Re: Setting maxTotalConnections and maxHostConnections

Posted by Oleg Kalnichevski <ol...@apache.org>.
Thinh,
There have been a few important fixes primarily in the authentication
code. I do recommend upgrading. 

There has been no API changes since 2.0-beta2 if my memory does not fail
me. So you should be able to drop in the final release in place of RC1

Oleg

On Thu, 2004-04-01 at 21:15, TPhannguyen@behr.com wrote:
> What happens when maxTotalConnections is hit?  Do all subsequent requests 
> get queued?  What happens when maxHostConnections is hit?
> 
> We are currently running RC1.  Should we upgrade to the final release? 
> Reading the notes, it seems like the release just has bug fixes and should 
> work in place of RC1.
> 
> Thanks,
> Thinh


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


Re: Setting maxTotalConnections and maxHostConnections

Posted by TP...@behr.com.
What happens when maxTotalConnections is hit?  Do all subsequent requests 
get queued?  What happens when maxHostConnections is hit?

We are currently running RC1.  Should we upgrade to the final release? 
Reading the notes, it seems like the release just has bug fixes and should 
work in place of RC1.

Thanks,
Thinh

Re: Setting maxTotalConnections and maxHostConnections

Posted by TP...@behr.com.
We are going to set up some load-testing and look at tuning that setting. 
I will post our findings when they come in.

Thanks for all your help.

Thinh



Ortwin Glück <or...@nose.ch> 
03/31/2004 11:59 PM
Please respond to
"Commons HttpClient Project" <co...@jakarta.apache.org>


To
Commons HttpClient Project <co...@jakarta.apache.org>
cc

Subject
Re: Setting maxTotalConnections and maxHostConnections






Eric Bloch wrote:
> Which JVM?  I usualliy bench against Sun's; ( JRockit benched worse last 

> I tried it (it was a year ago or more))

Sun and IBM are usually a little faster than Blackdown. JRockit has 
'ThinThreads' which may be a good thing here.

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



Re: Setting maxTotalConnections and maxHostConnections

Posted by Ortwin Glück <or...@nose.ch>.
Eric Bloch wrote:
> Which JVM?  I usualliy bench against Sun's; ( JRockit benched worse last 
> I tried it (it was a year ago or more))

Sun and IBM are usually a little faster than Blackdown. JRockit has 
'ThinThreads' which may be a good thing here.

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


Re: Setting maxTotalConnections and maxHostConnections

Posted by Eric Bloch <bl...@laszlosystems.com>.
I'm talking linux 1p and 2p systems running 2.4 kernels.  I'll give 2.6 
systems a try!

Which JVM?  I usualliy bench against Sun's; ( JRockit benched worse last 
I tried it (it was a year ago or more))

Thanks!

-Eric


Ortwin Glück wrote:

>
>
> Eric Bloch wrote:
>
>> My believe (and experience) is that you'll run into java thread 
>> scheduling delays (cpu bottlenecks) before you should hit connection 
>> limits on most servers, as long as you set these values reasonably high.
>>
>> -Eric
>
>
> Not necessarily. On a SMP System using a 2.6 Kernel this should be no 
> problem. 2.6 can handle systems with large thread counts nicely. Huge 
> difference to 2.4 kernels!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> commons-httpclient-dev-help@jakarta.apache.org


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


Re: Setting maxTotalConnections and maxHostConnections

Posted by Ortwin Glück <or...@nose.ch>.

Eric Bloch wrote:

> My believe (and experience) is that you'll run into java thread 
> scheduling delays (cpu bottlenecks) before you should hit connection 
> limits on most servers, as long as you set these values reasonably high.
> 
> -Eric

Not necessarily. On a SMP System using a 2.6 Kernel this should be no 
problem. 2.6 can handle systems with large thread counts nicely. Huge 
difference to 2.4 kernels!

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


Re: Setting maxTotalConnections and maxHostConnections

Posted by Eric Bloch <bl...@laszlosystems.com>.
My believe (and experience) is that you'll run into java thread 
scheduling delays (cpu bottlenecks) before you should hit connection 
limits on most servers, as long as you set these values reasonably high.

-Eric




Ortwin Glück wrote:

> Thinh,
>
> I think those parameters can drastically affect the performance of 
> your system. I suggest you draw a chart of your system and fill in 
> figures about computational load, number of connections between 
> machines and traffic with the estimated number of users. Perform some 
> load tests to get an idea about the load. You should then be able to 
> figure out where is the bottleneck in your system. Is it the network? 
> Is it the CPU on the Flash generation or on image transformation?
>
> By limiting the mentioned settings in HttpClient you effectively limit 
> the number of requests that can be processed in parallel. If you have 
> enough CPU power and network capacity there is no need to artificially 
> limit the number of parallel requests. Even if a limit is necessary, 
> this should be configurable on the server that processes the requests 
> (for instance by use of priority queues), not on the client side that 
> issues the requests.
>
> The only reason for you to limit HttpClient is to save resources on 
> the client side. My stomach tells me that you should avoid running 
> into the limit you set on HttpClient or you will experience weird lag 
> behaviour.
>
> However, it's hard to tell what will happen in a setup as complex as 
> yours. So be sure to perform real-life tests.
>
> HTH
>
> Ortwin Glück
>
> TPhannguyen@behr.com wrote:
>
>> [...] We are expecting to get North of 100,000 users a day [...]
>>
>> We use the dynamic coloring to allow our customers to paint rooms 
>> online. We are using httpclient on the app servers to request 
>> resources from the web servers and the dynamic coloring servers.  We 
>> transform all the resources into a Flash movie.
>>
>> [...]  The maxTotalConnections and maxHostConnections used to be
>> set at 20 on that application.  We have been recommended by the 
>> vendor to change that setting to 1000. [...]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> commons-httpclient-dev-help@jakarta.apache.org


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


Re: Setting maxTotalConnections and maxHostConnections

Posted by Ortwin Glück <or...@nose.ch>.
Thinh,

I think those parameters can drastically affect the performance of your 
system. I suggest you draw a chart of your system and fill in figures 
about computational load, number of connections between machines and 
traffic with the estimated number of users. Perform some load tests to 
get an idea about the load. You should then be able to figure out where 
is the bottleneck in your system. Is it the network? Is it the CPU on 
the Flash generation or on image transformation?

By limiting the mentioned settings in HttpClient you effectively limit 
the number of requests that can be processed in parallel. If you have 
enough CPU power and network capacity there is no need to artificially 
limit the number of parallel requests. Even if a limit is necessary, 
this should be configurable on the server that processes the requests 
(for instance by use of priority queues), not on the client side that 
issues the requests.

The only reason for you to limit HttpClient is to save resources on the 
client side. My stomach tells me that you should avoid running into the 
limit you set on HttpClient or you will experience weird lag behaviour.

However, it's hard to tell what will happen in a setup as complex as 
yours. So be sure to perform real-life tests.

HTH

Ortwin Glück

TPhannguyen@behr.com wrote:
> [...] We are expecting 
> to get North of 100,000 users a day [...]
> 
> We use the dynamic coloring to allow our customers to paint rooms online. 
> We are using httpclient on the app servers to request resources from the 
> web servers and the dynamic coloring servers.  We transform all the 
> resources into a Flash movie.
> 
> [...]  The maxTotalConnections and maxHostConnections used to be
> set at 20 on that application.  We have been recommended by the vendor to 
> change that setting to 1000. [...]

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


Re: Setting maxTotalConnections and maxHostConnections

Posted by Michael Becke <be...@u.washington.edu>.
Hi Thinh,

I assume you are talking about the number of connections for the 
MultiThreadedHttpConnectionManager.  There is no real formula that I'm 
aware of for the number of connections to use.  I would suggest load 
testing, and seeing what works best.  We would certainly be interested 
in any results you come up with.

Mike

On Mar 31, 2004, at 1:27 PM, TPhannguyen@behr.com wrote:

> Hello.
>
> We have a firewall, load balancer, 4 web servers, 6 app servers, 2
> database servers, and 2 specialty web servers/app servers on our
> production environment.  We average 20,000 users a day.  We are 
> expecting
> to get North of 100,000 users a day once our marketing campaign 
> launches.
>
> The specialty boxes are used to do search and dynamic coloring of 
> images.
> We use the dynamic coloring to allow our customers to paint rooms 
> online.
> We are using httpclient on the app servers to request resources from 
> the
> web servers and the dynamic coloring servers.  We transform all the
> resources into a Flash movie.
>
> The application used to request the resources and do the 
> transformation is
> third party.  The maxTotalConnections and maxHostConnections used to be
> set at 20 on that application.  We have been recommended by the vendor 
> to
> change that setting to 1000.  That is a significant change.  So, my
> question is is there any formula or rule of thumb that can be used to 
> set
> that number taking into factors such as load, setup, other settings, 
> etc.
>
> Thank you for any help you can provide.
>
> Thinh


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