Apache Server will not start due to memory leak.

Over the last year or so i have had to restart my Apache Webserver due to a memory leak (this is my theory so far) The behavior shows up as some or all of the web servers going unresponsive and i have to run a script i created to kill the httpd processes and restart httpd. While this does the job, i have been looking to implement Monit to auto restart the processes so i don’t have to do anything. Well this morning a different problem happened. i ran the script and the web server started normally. Then shortly after that, it stopped. I attempted to restart and it just failed.  Usually when it fails it says something is running on port 80 and thats why you have to kill httpd. well this time i ran ps aux |more and looked for any stuck apache instances. there were none. so i looked at the error_log in “/etc/httpd/logs/”  and the following was showing up.

[Sun Mar 13 11:10:27 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Mar 13 11:10:27 2011] [error] (28)No space left on device: Cannot create SSLMutex

I searched around for an answer and found the following line which cleans up the smephores.

ipcs -s | grep apache | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'

I’m not sure what exactly happened, but im guessing its a problem with one of the websites i host. I will need to look into this further. maybe its a parameter of the PHP  module. time will tell.

For info for my readers, i will say that i am Running Centos 5.5 64bit. I am using Virtualmin for the hosting panel and we have around 10 websites on the server currently. none of the websites are a heavy load at the moment. I will be implementing monit over the coming weeks so I don’t have to touch it. but i really need to find out why this is occurring.