You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Guernsey, Byron (GE Consumer & Industrial)" <BY...@GE.COM> on 2005/05/11 23:52:58 UTC

Jk 1.2.10+ & Tomcat 4.1.x slight problem

I'm running into a minor issue with jk 1.2.12, Apache 2.0.52-MPM, and
Tomcat 4.1.31 server.

It appears that Tomcat 4.1.xx is closing every ajp13 connection after 1
request. 

It also appears that if I get a burst of lets say 10 connections at once
in Apache, that creates 10 connections to Tomcat.  Tomcat doesn't seem
to allow them to ajp-keepalive, so it closes them.  The next request
that the same apache process receives then attempts to reuse one of
those 10 connections from the cache.  Those 10 connections are dead, and
with the default retries set to 3, it cycles through 3 of them and then
returns a 500 error.

As I understand it, my options are:

1. Upgrade to Tomcat 5 (so ajp13 connections are reused)
2. Set the retries on the worker equal to my RequestPerChild value
3. Switch Apache to a prefork model
4. ??????

First, am I missing something about Tomcat 4.1.xx that would enabled
reuse of ajp13 connections?  Its not out of the question that I have it
misconfigured, but looking at the code for the connectors in tomcat 4.1
it would appear that it closes the connection when its finished
servicing a request.

Second, should the JK_RETRIES value in mod_jk maybe be set dynamically
rather than assuming it will succeed in 3 retries?  Even with a properly
configure Tomcat 5 instance, if 3 consecutive AJP13 workers die
coincidentally at the head of the cache, the next attempt to use the 1st
one from the cache will fail 3 times in a row and give a 500 server
error.

Third, if I turn off caching of workers (set the cachesize to 1), does
this mean each thread will open a new connection each time- or will they
attempt to share a single connection and wait in line on it?  I guess I
can refer to source code on this one, but if someone knows it would help
save me some time.  I have 35 threads per process now and don't want all
of them waiting on the single ajp connection.  I do want them to open
parallel connections- so I assume I need to allow a cachesize equal to
threads per child.

I'm thinking about doing #2 above (set retries equal to threads per
child), but I'm concerned about the 100ms delay added after JK_RETRIES
is reached.  In my case, every single worker is closed after one use, so
I have the opportunity for a significant delay if it has to cycle
through many dead workers during retries. 40 dead workers, for instance,
would result in a potential of 3,700ms of sleeping if no other threads
were attempting to cycle through the list at the same time.  I guess if
I change JK_RETRIES to a higher value, it will eliminate the sleep until
I surpass that value.  Its a shame that the default JK_RETRIES (3) is
not configurable before the delays are added, or that there isn't a
setting that say "cycle through the cache once before adding a sleep to
retries"

Byron


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org