Apache Slowdown and Piped Logs
Posted on 2007-07-24
I currently have websites on a Windows Server 2003 box, served by Apache 2.0.59 and Tomcat 5.0.28 for dynamic content. Most of our servers are not open to the internet and experience fairly low load. We have been noticing tremendous slowdowns in serving requests and intermittent loss of logging. We currently rotate logs with rotatelogs.exe that ships with Apache.
Here's a sample of how I've been setting up virtual hosts
CustomLog "|bin/rotatelogs.exe logs/app_name-access-%Y%m.log 86400" common env=!dont_log
ErrorLog "|bin/rotatelogs.exe logs/app_name-error-%Y%m.log 86400"
JkLogFile "|bin/rotatelogs.exe logs/app_name-modjk-%Y%m.log 86400"
One of our servers has 8 virtual hosts. I see 50 rotatelogs processes associated with the parent and child processes and many more rotatelogs processes not associated with Apache any more. I've checked, they are orphaned processes that weren't killed when Apache restarted some time in the past.
After a while the server starts to slow down to the point where it effectively stops serving requests. A restart of the Apache HTTPD service solves this problem, at least temporarily. The Apache HTTPD service needed to be restarted 5 times in the last 3 business days.
Can the orphaned rotatelogs processes still affect the Apache HTTPD service?
Can anything be done to reduce the number of orphaned or zombie rotatelogs processes? From my reading, it doesn't appear possible.
Can mod_log_rotate or any other Apache module rotate the Error or mod_jk logs?
I can provide some additional configuration information.