You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ge...@gta-travel.com on 2008/12/30 17:53:04 UTC

Isolating slow and fast connections using apache/modjk

Hi
We have an apache server that load balances two types of applications
across different stacks of tomcats. 

We have a tomcat stack for requests that processes very quickly, lets
call this stack A and a tomcat stack for slower running
request(different type of application) named stack B.

We limit connections on the apache to protect the underlying layers eg:
ServerLimit     5
ThreadLimit     10

StartServers     5
ThreadsPerChild       10
MinSpareThreads       10

MaxClients 50

MaxSpareThreads       50

However if stack A or B misbehave and eat up all of the available apache
connections it can cause a denial of service for the other stack that is
on the same apache.

My question really is where I should be doing the isolation. I am not
sure whether I can achieve this in modjk or whether I should rather be
running separate apache instances for tomcat stack A and B. I considered
using virtual hosts but I believe they would still share the overall
amount of threads as defined above.

After writing this I think the question is probably more relevant on an
apache list but because we are using modjk and tomcat I thought I would
ask anyway.

Regards

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

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


Re: Isolating slow and fast connections using apache/modjk

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Gerhardus,

On 30.12.2008 17:53, Gerhardus.Geldenhuis@gta-travel.com wrote:
> Hi
> We have an apache server that load balances two types of applications
> across different stacks of tomcats.
>
> We have a tomcat stack for requests that processes very quickly, lets
> call this stack A and a tomcat stack for slower running
> request(different type of application) named stack B.
>
> We limit connections on the apache to protect the underlying layers eg:
> ServerLimit     5
> ThreadLimit     10
>
> StartServers     5
> ThreadsPerChild       10
> MinSpareThreads       10
>
> MaxClients 50
>
> MaxSpareThreads       50
>
> However if stack A or B misbehave and eat up all of the available apache
> connections it can cause a denial of service for the other stack that is
> on the same apache.
>
> My question really is where I should be doing the isolation. I am not
> sure whether I can achieve this in modjk or whether I should rather be
> running separate apache instances for tomcat stack A and B. I considered
> using virtual hosts but I believe they would still share the overall
> amount of threads as defined above.

Yes, they will. So if you want best separation, yes you would use two 
apache instances.

Of course you could try to find a middle way between absolute separation 
and consolidation, the latter allowing to use resources of stack A for 
stack B (or vice versa) up to a certain amount.

You can't map httpd threads to URLs, and since the mod_jk connection 
pools are process local, you can't really efficiently divide the 
connections (=threads) available for requests to A and available for 
requests to B.

What's possible though is using reply_timeouts. Most of the time 
"misbehave" is getting slow or stuck.

Since

   concurrency = throughput * response_time

you can at least partially prepare for eating up all available 
concurrency by limiting response times. Unfortunately your maximal 
concurrency of 50 is not very big, so one of the two stacks could 
quickly eat all available threads.

Until version 1.2.26 of mod_jk you had to use two separate workers for A 
and B in order to set reply timeouts to different values, starting with 
the recent 1.2.27 you can use reply timeouts per mount using mount 
extensions.

> After writing this I think the question is probably more relevant on an
> apache list but because we are using modjk and tomcat I thought I would
> ask anyway.

Regards,

Rainer

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