Hi, 

We have Apache and Tomcat running on different servers, using mod_jk. 
>From time to time we got the following errors from Tomcat.

                [Thu Jul 10 16:43:21 2008]  [jk_ajp_common.c (1250)]:
Tomcat is down or network problems. No response has been sent to the
client (yet)
                [Thu Jul 10 16:43:21 2008]  [jk_ajp_common.c (1449)]:
ERROR: Receiving from tomcat failed, recoverable operation. err=0
                [Thu Jul 10 16:43:21 2008]  [jk_ajp_common.c (783)]:
ERROR: can't receive the response message from tomcat, network problems
or tomcat is down (200.200.1.1
                :8009), err=-1
                [Thu Jul 10 16:43:21 2008]  [jk_ajp_common.c (1468)]:
sending request to tomcat failed in send loop. err=0

We were able to simulate the failure, and found out that Tomcat became
unresponsive once the number of threads reach 252. We double check all
our configuration settings but couldn't find anything wrong. Any help
will be greatly appreciated.

Here are our settings:

AJP connector:

I suggest setting maxThreads in TOMCAT_HOME/conf/server.xml for AJP
connector to slightly higher value than Apache's thread limit


Please see below maxThreads values in  our conf (I don't deleted the
comments lines) 

  <Connector protocol="AJP/1.3" port="8009" maxThreads="600"
minSpareThreads="5" maxSpareThreads="100" acceptCount="500" debug="0"
connectionTimeout="60000" enableLookups="false"
disableUploadTimeout="true" useURIValidationHack="false"
redirectPort="4443" />

MPM - we use prefork:

##
## Server-Pool Size Regulation (MPM specific)
##
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept
spare
# MaxSpareServers: maximum number of server processes which are kept
spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process
serves

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
MaxClients       250
MaxRequestsPerChild  1000
</IfModule>

Worker.properties:

# list the workers by name
worker.list=app

# ------------------------
# First tomcat server
# ------------------------
worker.app.port=8009
worker.app.host=SERVER_NAME
worker.app.type=ajp13

# worker "app" use up to 10 sockets, which will stay no more than 10mn
in cache
worker.app.cachesize=10

# worker "app" ask operating system to send KEEP-ALIVE signal on the
connection
worker.app.socket_keepalive=1

# worker "app" want ajp13 connection to be dropped after 5mn == 300
(timeout), 10 min == 600
worker.app.socket_timeout=60
worker.app.cache_timeout=60

#This features has been added in jk 1.2.6 to avoid problem with hung
tomcat's
worker.app.connect_timeout=60

#forwarding to it a request. The parameter is the delay in milliseconds
to wait for the PONG reply.
#This features has been added in jk 1.2.6 to avoid problem with hung
tomcat's
#worker.app.prepost_timeout=60
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
#worker.app.lbfactor=100
#
# END workers.properties


Zoran Bajbutovic 
Email: [EMAIL PROTECTED]



Reply via email to