[CentOS] Apache jserv monitoring?

Sean Carolan scarolan at gmail.com
Wed Jun 11 01:19:34 UTC 2008

> How about setting up a cron to monitor it and auto restart if it's not
> responding?
> wget -q --timeout=30 http://localhost:8008/ -O /dev/null || (command to
> restart jserv)

I tried pulling up port 8008 in a web browser, but it doesn't work
quite like that.  Apache is configured with mod_jserv like this:

    <IfModule mod_jserv.c>
        ApJServMount /servlets ajpv12://hostname.web.domain.com:8008/root
        ApjServAction .html /servlets/gnujsp

Simply pulling up the URL in a web browser always returns an error:

Status: 400 Bad Request
Servlet-Error: Malformed data sent to JServ

> I'm not familiar with jserv but it looks like it serves a purpose similar
> to tomcat, just a much older code base.

Yes, it is very similar to tomcat.  Both have a java process, with a
minimum and maximum heap size, etc.  Unfortunately I don't know of an
easy way to test the java process to make sure it is healthy, short of
pulling up the front-end URL in a web browser. The problem here is, it
is possible that one URL could be down, but the other ones still
functioning correctly.   We don't want to restart java just because of
a false positive on one URL.

> When the app had a memory leak it helped me sleep better at night, as
> the apps were restarting about 10x a day until the developers found the
> source of the leak. Fortunately the app restarted reliably 99.9% of the
> time.

We are not quite having to restart ten times a day, but there actually
is no chance of a code fix in my situation since this is deprecated
code, and the customer is not willing/able to upgrade.  This is why we
want to simply auto-restart the JVM when the server gets into this

> Ideally the "load balancer" should be performing "health checks" against
> the back end nodes and stop sending traffic to them if they are no
> longer healthy. I'm not familiar with the load balancing method your
> using, only with bigger load balancers like F5 BigIP.

We have such a load-balancing device but it sits in front of the web
server, not behind (the web servers are load balanced too).  There is
an apache plugin that handles the jserv load balancing.

More information about the CentOS mailing list