Thursday, 29 May 2008

Apache memory leak Fix

I ran into an apache memory leak today... the symptoms where:
[root@www /]# service httpd restart
Stopping httpd: [OK]
Starting httpd: [FAILED]
[root@www /]# service httpd status
httpd dead but subsys locked

Ok that was weird... so I check the logs in /var/log/httpd/error_log

[emerg] (28)No space left on device: mod_fcgid: Can't create global pipe mutex
[crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock
Configuration Failed

so... memory kinda full of it... solution:
[root@www /]# ipcs -s | grep apache
0x00000000 7897096 apache 600 1
0x00000000 7929865 apache 600 1
0x00000000 7962634 apache 600 1
0x00000000 7995403 apache 600 1
0x00000000 8028172 apache 600 1
0x00000000 8060941 apache 600 1
0x00000000 8093710 apache 600 1
0x00000000 8126479 apache 600 1
0x00000000 8159248 apache 600 1
0x00000000 8192017 apache 600 1
 ok... right on the money! so continue...

[root@www /]# ipcs -s | grep apache | awk ' { print $2 } ' | xargs ipcrm sem
resource(s) deleted
 and all is ok with the world again :)

Carlos Rivero on the same issue states "When dealing with mem-leaks in my mod_perl-apps I ran into a curious apache-problem" and since it is 4 in the morning I will just agree with him :) Damn that mod_perl then!

Anyway.. problem solved apache back up and running

Thank you for playing :)

No comments:

Post a Comment