I'm using CentOS 5 on a VPS with 512MB memory. I find httpd often runs out of memory, which lags the whole system. But I cannot find out the reason.
When I use
top to monitor processes, sometimes one of the
httpd takes out 90+% memory, then SSH hangs up for seconds. When
top refreshes again, that
httpd has been killed by kernel. The issue repeats a few minutes later, again and again.
Here is the system log: http://pastebin.com/bszy9ahq
My Apache prefork conf:
<IfModule prefork.c> StartServers 1 MinSpareServers 3 MaxSpareServers 7 ServerLimit 128 MaxClients 128 MaxRequestsPerChild 4000 </IfModule>
Server version: Apache/2.2.3 Server built: Mar 24 2012 13:32:42 Server's Module Magic Number: 20051115:3 Server loaded: APR 1.2.7, APR-Util 1.2.7 Compiled using: APR 1.2.7, APR-Util 1.2.7 Architecture: 32-bit Server MPM: Prefork threaded: no forked: yes (variable process count) Server compiled with.... -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=128 -D HTTPD_ROOT="/etc/httpd" -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="run/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="logs/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf"
Is there any way to know what script cause the memory issue, or just apache related? And how to resolve...