You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by pt...@intec.ugent.be on 2008/08/08 10:59:34 UTC

Apache / mod_jk / Jboss-tomcat weirdness

Hello everyone,

I previously asked this on the Apache users mailing list - but it occurred
to me that this list may be more appropriate)


I'm trying to figure out some weirdness in a fairly large web environment.

We're running a web environment using RHEL 4, Apache 2.0.52 with Worker
MPM, mod_jk 1.2.20 and jboss/tomcat application servers (Jboss 4 / tomcat55).
There's a firewall between our web and application servers, and I have
read about mod_jk and firewalls (i.e. socket_keepalive = 1).

A weird thing I see is that sometimes, the apache server status page
displays requests/threads in the "W" (sending reply) state up to Apache
timeout, while the Jboss Jk status shows no threads for that client in the
"Service" state.

In fact, most of the "busy" threads are reported to be in the "Keepalive"
state - I presume due to the use of  socket_keepalive = 1 in
workers.properties.

This means my problem kind of resembles the one described at
http://blogs.warwick.ac.uk/chrismay/entry/wierd_apache_mod/, where Apache
threads get stuck in the "W" state instead of being closed (as to be
expected) - as if client-apache and apache/mod_jk - backend appserver
connections are not "detached".

I'm wondering what can cause this behaviour, as my worker.properties has
the following:

socket_timeout=60
connect_timeout=30000
prepost_timeout=30000
reply_timeout=120000
socket_keepalive=1
connection_pool_timeout=600

When socket_keepalive=1, how long does a connection exist between mod_jk
and the application server? How can I control it?

Do I need to use cache_Size and cache_timeout in workers.properties? I
don't quite get their explanation - but cache_timeout does talk about
reducing the number of threads on the backend.

It seems the poster pointed to by the link I gave solved his problem by
implementing the mod_jk firewall howto in the end (i.e. set
socket_keepalive to 1) - but I am still having similar issues it seems.
Does this ring a bell with anyone?


Kind regards,
Pieter



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Apache / mod_jk / Jboss-tomcat weirdness

Posted by Mladen Turk <mt...@redhat.com>.
pthyseba@intec.ugent.be wrote:
> 
> A weird thing I see is that sometimes, the apache server status page
> displays requests/threads in the "W" (sending reply) state up to Apache
> timeout, while the Jboss Jk status shows no threads for that client in the
> "Service" state.
>

Fix your firewall. It silently closes the connections without
sending FIN to the other node.

> In fact, most of the "busy" threads are reported to be in the "Keepalive"
> state - I presume due to the use of  socket_keepalive = 1 in
> workers.properties.
>

That's not the reason. AJP connections are always in Keepalive
state (Keepalive here means connection reuse)

> 
> It seems the poster pointed to by the link I gave solved his problem by
> implementing the mod_jk firewall howto in the end (i.e. set
> socket_keepalive to 1) - but I am still having similar issues it seems.
> Does this ring a bell with anyone?
>

socket_keepalive uses OS property for SO_KEEPALIVE. In many systems
it defaults to very huge value (5 minutes +), so it might not be
relevant if your firewall setting has lower timeout.


Regards
-- 
^(TM)

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Apache / mod_jk / Jboss-tomcat weirdness

Posted by Rainer Jung <ra...@kippdata.de>.
pthyseba@intec.ugent.be schrieb:
> We're running a web environment using RHEL 4, Apache 2.0.52 with Worker
> MPM, mod_jk 1.2.20 and jboss/tomcat application servers (Jboss 4 / tomcat55).
> There's a firewall between our web and application servers, and I have
> read about mod_jk and firewalls (i.e. socket_keepalive = 1).
> 
> A weird thing I see is that sometimes, the apache server status page
> displays requests/threads in the "W" (sending reply) state up to Apache
> timeout, while the Jboss Jk status shows no threads for that client in the
> "Service" state.

In addition to Mladen: "W" for apache usually means that it thinks it is 
working on a request/reponse. I would do a couple of "gstack" for the 
httpd processes and check, in which stack the processing threads are. 
Most interesting will be the frames near the top of each stack.

Regards,

Rainer

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org