Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have apache in front of Tomcat, using mod_rewrite and mod_proxy to relay requests while serving static content directly.

The Tomcat server can get bogged down and stop responding, or just plain crash. My problem is that in those cases it takes the apache httpd down with it. And it won't come back up even after I set Tomcat straight.

When this happens, the only way to get apache working again is to issue a stop command, then kill -9 remaining apache processes, and lately I also had to run ipcrm to remove semaphores, otherwise I get a "No space left on device" error.

My guess is that all of apache's workers become proxy threads, waiting to time out, while nothing else is being served.

I don't want to change the ProxyTimeout, because during normal operation, some requests can really take a long time. But I would like a way to tell apache to stop all the waiting proxy requests it has right now and start afresh.

Is there such a thing, or is there another way I should approach this?

I'm using ubuntu 8.04.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You could try using mod_jk rather than mod_proxy. mod_jk allows you to configure a maximum number of connections to your tomcat. In your workers.properties file use:

worker.worker_name.connection_pool_size = 10

The value you use should be lower than the maximum number of connections in your Apache configuration. Hopefully, what should happen is that once that number of connections are waiting for tomcat, any more requests will return a 500 error, but you'd still have threads left to serve other requests.

There is a note saying that if you're using the prefork MPM, then you shouldn't set this value to higher than one, so this will only work if you're using the threaded MPM.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.