Monitor RAM usage on CentOS and restart Apache at a certain usage
Posted
by Chris
on Server Fault
See other posts from Server Fault
or by Chris
Published on 2010-05-13T17:36:27Z
Indexed on
2010/05/13
19:55 UTC
Read the original article
Hit count: 500
Hi, I'm running a CentOS 5.3 server with a basic LAMP stack. I've optimized LAMP and my code to run efficiently as possible, but Apache has a memory leak somewhere that kills my server every hour or so. What is the best way to write a script that will monitor the memory usage and if it peaks over, say, 450MB kill all the Apache processes and restart Apache. I know C++/PHP and basic Linux server administration but I'm not familiar with Perl or bash scripting. I'd be open to learn any solutions, though, as a temporary solution while I find the issue.
© Server Fault or respective owner