tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: Error 503 ocurring when server under load
Date Fri, 08 Oct 2010 08:31:03 GMT
On 08/10/2010 00:07, Rob G wrote:
> Thanks to all for their replies to date. Much appreciated, I'll
> respond to some of the points raised. Apologies if I'm asking basic
> stuff but still getting my ahead around Tomcat and Apache integration.
> 
> On 7 October 2010 18:31, André Warnier wrote:
> 
>> Your configuration looks very clean to me (no unnecessary settings etc.),
>> which in this case is a plus (a good base to start tuning).
> Thank you
> 
>> You may want to upgrade Tomcat to the latest version (6.0.29).
> Noted
> 
>> For example, at the moment these errors happen, what are these Tomcats
>> really doing ?
>> Are they really busy each processing 200 requests, with 200 threads running
>> and actually doing something ? (200 is the default for the "maxThreads"
>> attribute of the AJP Connector).
> Unfortunately I'm not in a position to conduct realtime monitoring of
> the server and Tomcat. Is there a way to log this thread data?

How do you get log data?

>> If yes, then you may just need a leaner application, or a bigger system
>> (more RAM, faster CPU), or more systems.  What does the Task Manager tell
>> you about the total system load ?
> Again, unfortunately not in a position to monitor  in real time.

You can enable JMX and connect remotely on a specified port to get a
look inside the JVM>

>> If not, and many of these threads are waiting, then you may have an issue
>> with a keepAlive that is too long.
>> See http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html, for the
>> connectionTimeout and keepAliveTimeout attributes.
> Will do
> 
>> Whatever you do, first get an idea of the starting situation.  Then modify
>> one setting at a time, and observe (and note) the effects.
> Sensible advice
> 
> Pid wrote:
>> OK.  Is there anything else different apart from the Servlet container?
> I'm not sure what you mean?

Did you change DB too, or is was it a simple migration?

>> Why do you have two Tomcat instances?  (It's not a trick question, I'm interested
in your reasoning.)
> Load balancing. I thought/guessed that two instances would be
> sufficent. Perhaps this was incorrect and I need more?

Maybe, maybe not.

I was trying to understand why you had two instances, rather than one
with, say, more threads configured.

Load balancing two Tomcat instances which are both using the same
underlying computing resource will not offer a tangible benefit in terms
of throughput / response time compared to a suitably configured single
instance.

If you're on a 32bit system and are hitting process memory limits, you
might need two instances to cope with the load.


>> How many threads & server instances did you have before?
>> What were your Java -Xmx etc settings before, and now?

>> Are you using an Executor?
> I'll have to check, but I think it's safe to say that they are set to
> the default values as I don't recall changing anything relating to
> them.
>
>> Thread dumps from a maxed out Tomcat will tell you what each Thread is waiting for.
 Collect a series of these during high load periods to find
> out what's happening.
> I'll have to figure out how to do this, but sounds a good idea.

Do you have remote access to the machine?

There are command line tools with JDK 6 (6.0.21 is the latest) which are
useful.  E.g. jstack, jmap.

If you have remote access to the GUI, JDK 6 also has JConsole and
VisualVM which provide metric tonnes of useful information.

Otherwise you can connect those tools, for slightly less output,
remotely via JMX.  Be sure to use :

 org.apache.catalina.mbeans.JmxRemoteLifecycleListener
 http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html


Please also check the port numbers you have in use for each Tomcat
instance.  Are the Tomcats installed and run as a service?


p

> Christopher Schultz wrote
>> I think you might want to compare the request processor counts you have for Tomcat
versus mod_jk: the default maxThreads for a Tomcat <Connector> is 200, while your MaxClients
settings might be different on your Apache httpd configuration.
> Excuse my ignorance, but can you clarify where I check these settings?
> 
>> I believe that only the Worker MPM is available on Microsoft Windows. Have you explicitly
configured an MPM?
> Since I don't know what an MPM is I'm going to say no.
> 
>> Since you're using Apache 2.x, mod_jk should be able to auto-configure this value
for you.
> Do I need to set anything to allow this auto config to happen?
> 
>> From my reading, you may be limiting yourself to 10 simultaneous connections from
Apache httpd to Tomcat, and others will get a 503.
> What lead you to that conclusion?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


Mime
View raw message