tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JNeuhoff <>
Subject Re: mod_jk replacement?
Date Tue, 23 Jan 2007 00:20:03 GMT

Thank you for your explanations.

> I've read all your posts to this thread and
> Apache-mod_jk-memory-leak, and you didn't post the
> server.xml config for AJP/1.3 connector, neither the
> essential httpd.conf directives.

Here are connection-related directives from the the httpd.conf we have been
using so far:

Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum  number of requests a server process serves
<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild  0
### mod_jk 1.x configuration for connecting to Tomcat 5.5
LoadModule    jk_module  modules/
JkWorkersFile "C:/Program Files/Apache Software Foundation/Tomcat
JkLogFile     "C:/Program Files/Apache Software Foundation/Tomcat
JkLogLevel    info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat     "%w %V %T %r %s"
JkMount  /jsp-examples/* ajp13
JkMount  /servletsp-examples/* ajp13
JkMount  /manager/* ajp13
JkMount  /ohpr/* ajp13
JkMount  /demo-b/* ajp13

And our

# Define 1 real worker using ajp13

# Set properties for worker1 (ajp13)

And in the server.xml we use this:

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" 
               enableLookups="false" redirectPort="8443" protocol="AJP/1.3"

> When connecting Apache Httpd and Tomcat via mod_jk the major
> thing you have to take into account is the fact that the
> connection between those two is constant!
> If any part closes this (AJP) connection you will observe
> 'memory leaak', meaning thread will stay open without the
> clue the other part closed the connection.

Maybe I mis-understood the meaning of the timeout settings because I always
thought that these would genuinely release the underlying TCP connections
(except for the connection_pool_minsize number of TCP connections). 

> Next thing is difference between MaxClients (httpd) and
> maxThreads(Tomcat). Once established the connection will
> stay open for the server lifetime.

In our case that would mean maxThreads=200 (the default value). I am not
sure about the default value of the MaxClients directive. I thought there
was only one cild process on Windows 2003, with up to 250 threads
(ThreadsPerChild=250), with one connection per thread. Our
MaxRequestsPerChild is 0, hence the child process should never expire. 

I still don't quite understand how the connection pool is managed. I was
hoping to have unused connections (and their associated threads) released
after a certain period of idle time, to conserve memory. Is there any
documentation which describes the inner working of the connection pool
management in conjunction with the various timeouts and other settings? 

I am still puzzled over the fact that Windows 2003 reports no established or
active connections between Apache and Tomcat after the timeout(s) on our
server, yet Tomcat thinks there are 15 or so ready connections. If the
reported number of TCP connections involving ajp1.3, according to Windows'
'netstat -a', has to be same as the number of connections reported by the
Tomcat manager, then I can imagine that mod_ajp gets connection aborted
errors because Windows thinks that some or all of these connections don't
exist anymore!



View this message in context:
Sent from the Tomcat - User mailing list archive at

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message