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 Thu, 07 Oct 2010 22:30:09 GMT
On 07/10/2010 17:59, Rob G wrote:
> Hey all,
> 
> Recently migrated a production site (mixture of Servlets and JSPs)
> from Oracle Application Server to Apache/Tomcat. Since then we have
> seen numerous HTTP Error 503 - Service unavailable errors at peak
> times when site is under load. mod_jk.log has the following error
> message(s):
> 
> [2184:1952] [error] jk_lb_worker.c (1473): All tomcat instances
> failed, no more workers left
> 
> I'm looking for help in trying to tweak settings to prevent this, or
> confirmation that I've configured the setup correctly.
> 
> Many thanks
> Rob
> 
> Platform:
> Windows Server 2003 SP2
> 
> Setup:
> Two tomcat instances with a single Apache front end, all on the same server
> 
> Versions
> Tomcat: 6.0.24
> Apache: 2.2.16
> mod SSL: 2.2.16
> Open SSL: 0.9.8
> mod_JK:1.2.30
> 
> Conf:
> httpd.conf:
> 
> <IfModule mod_jk.c>
> 
>     JkWorkersFile conf/workers.properties
>     JkLogFile logs/mod_jk.log
>     JkLogLevel error
>     JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>     JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
>     JkRequestLogFormat "%w %V %T"
> 	
>    <Location /*/WEB-INF/*>
>         AllowOverride None
>         deny from all
>    </Location>
> 
>     JkMount /examples balancer
>     JkMount /examples/* balancer
>     JkMount /App1/* balancer
>     JkMount /App2/* balancer
>  </IfModule>
> 
> Workers.properties:
> workers.tomcat_home="C:\tomcat1"
> workers.java_home="C:\Program Files\Java\jdk1.6.0_18"
> ps=\
> 
> # Define workers
> #worker.list=worker1,worker2
> worker.list=balancer
> 
> # Set properties for worker worker1 (ajp13)
> worker.worker1.type=ajp13
> worker.worker1.host=localhost
> worker.worker1.port=8009
> worker.worker1.lbfactor=1
> 
> worker.worker1.cachesize=10
> worker.worker1.connection_pool_timeout=300
> worker.worker1.socket_keepalive=FALSE
> #worker.worker1.recycle_timeout=300
> 
> # Set properties for worker worker2 (ajp13)
> worker.worker2.type=ajp13
> worker.worker2.host=localhost
> worker.worker2.port=8019
> worker.worker2.lbfactor=1
> 
> worker.worker2.cachesize=10
> worker.worker2.connection_pool_timeout=300
> worker.worker2.socket_keepalive=FALSE
> #worker.worker2.recycle_timeout=300
> 
> worker.balancer.type=lb
> worker.balancer.balance_workers=worker1,worker2
> worker.balancer.method=R
> worker.balancer.sticky_session=True
> 
> Server.xml (same for both tomcat instances apart from jvmRoute):
> <?xml version='1.0' encoding='utf-8'?>
> <Server port="8005" shutdown="SHUTDOWN">
> 
>   <Listener className="org.apache.catalina.core.AprLifecycleListener"
> SSLEngine="on" />
>   <Listener className="org.apache.catalina.core.JasperListener" />
>   <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"
> />
>   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
>   <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
> />
> 
> 
>   <GlobalNamingResources>
> 
>     <Resource name="UserDatabase" auth="Container"
>               type="org.apache.catalina.UserDatabase"
>               description="User database that can be updated and saved"
>               factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>               pathname="conf/tomcat-users.xml" />
>   </GlobalNamingResources>
> 
>   <Service name="Catalina">
> 
>     <Connector port="8080" protocol="HTTP/1.1"
>                connectionTimeout="40000"
>                redirectPort="8443" />
> 
>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
> 
>     <Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">
> 
>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>              resourceName="UserDatabase"/>
> 
>       <Host name="localhost"  appBase="webapps"
>             unpackWARs="true" autoDeploy="true"
>             xmlValidation="false" xmlNamespaceAware="false">
> 
>       </Host>
>     </Engine>
>   </Service>
> </Server>

[Answers own previous question]  Weirdness.

In addition to the previous relevant questions:

Are both of the two Tomcat instances actually working?  If the shutdown
port is identical on both (8005), then I think the second one won't
start up.  The connectors certainly won't.

Also, if you're using mod_jk 1.2.30 there's an example config in the
install dir which uses the template config method and has good default
settings.


p



Mime
View raw message