Bajbutovic, Zoran schrieb:
You mean the number of threads inside Tomcat?
We use prefork mod_jk, so basically it is not the number of
threads but rather the number of processes created by Apache. When the
number of processes (client connections) on Apache side reaches 252,
mod_jk cannot get responses from Tomcat and logs the errors I provided.
Similar problem is explained on this forum:
http://archives.devshed.com/forums/java-118/mod-jk-replacement-2154649.h
tml
However, you may see that I have specified MaxRequestsPerChild, together
with connectionTimeout for both mod_jk and Tomcat.
Hmmm, something doesn't really fit together. You configure MaxClients to
250, but you can have 252 parallel client connections and still get an
answer from httpd?
I assume you set the 250 connections limit later.
Timeouts will ensure, that idle connections and the related threads get
freed on both sides, and that we detect a problem earlier than without
timeouts. What they can't fix, is if something on the Tomcat side, more
precisely in your webapp gets stuck. So usually it is a good idea to get
a thread dump when the problem arises, to check, if there are idle
threads in Tomcat, or if they got all used up, e.g. waiting for database
or whatever else.
Which version of mod_jk are you using?
Which version of httpd and Tomcat are you using?
Which platform?
I will post those later today.
Regards,
Rainer
-----Original Message-----
From: Rainer Jung [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 5:04 AM
To: Tomcat Users List
Subject: Re: Apache/Tomcat - mod_jk can't receive response from Tomcat
Bajbutovic, Zoran schrieb:
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
You mean the number of threads inside Tomcat?
What are those doing? Try to get a thread dump, look at it, and if you
find it to difficult, provide it to the list.
our configuration settings but couldn't find anything wrong. Any help
will be greatly appreciated.
Which version of mod_jk are you using?
Which version of httpd and Tomcat are you using?
Which platform?
Usually the messages would indicate, that your webapp inside Tomcat got
stuck and ate all the available threads. One can easily check with a
thread dump.
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]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]