I'm running a WHM/cPanel server on CentOS 6.6 with Apache 2.4 and PHP 5.5. Every week or so, CPU usage will shoot up to 100% across all six cores and stay there until Apache is restarted, at which point everything returns to normal. Interestingly, Apache's server-status
page doesn't seem to know these processes exist:
Top:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
25901 nobody 20 0 1973m 28m 276 R 74.8 0.4 3:39.30 httpd
24861 nobody 20 0 1973m 28m 280 R 74.1 0.4 12:05.31 httpd
25076 nobody 20 0 1973m 28m 276 R 65.8 0.4 10:09.38 httpd
24727 nobody 20 0 1973m 28m 280 R 64.5 0.4 14:37.09 httpd
25874 nobody 20 0 1973m 28m 276 R 64.5 0.4 3:57.69 httpd
24747 nobody 20 0 1973m 28m 276 R 64.1 0.4 15:06.89 httpd
25998 nobody 20 0 1973m 28m 276 R 63.8 0.4 2:40.92 httpd
25624 nobody 20 0 1973m 28m 276 R 61.8 0.4 5:28.76 httpd
25646 nobody 20 0 1973m 28m 276 R 58.8 0.4 5:07.88 httpd
Status page:
Server Version: Apache/2.4.12 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
Server MPM: event
Server Built: Mar 27 2015 11:20:11
Current Time: Tuesday, 09-Jun-2015 09:21:07 CDT
Restart Time: Tuesday, 02-Jun-2015 11:38:37 CDT
Parent Server Config. Generation: 12
Parent Server MPM Generation: 11
Server uptime: 6 days 21 hours 42 minutes 30 seconds
Server load: 8.17 7.35 10.46
Total accesses: 461541 - Total Traffic: 10.7 GB
CPU Usage: u111.81 s369.94 cu305989 cs438.15 - 51.4% CPU load
.774 requests/sec - 18.7 kB/second - 24.2 kB/request
7 requests currently being processed, 118 idle workers
PID Connections Threads Async connections
total accepting busy idle writing keep-alive closing
21715 1 yes 1 24 0 1 0
4766 0 yes 0 25 0 0 0
10222 0 yes 0 25 0 0 0
10278 6 yes 6 19 0 0 0
10194 0 yes 0 25 0 0 0
Sum 7 7 118 0 1 0
_____________________W__________________________________________
_____________W__W____W____W_W___W___.........................___
______________________
None of the requests reported by Apache's status page seem to be of any interest, which makes sense since none of the CPU-hogging PIDs are listed. Memory usage, disk I/O, and network traffic all remain relatively flat throughout, and the problem doesn't surface at a consistent time of day. There are dozens of small sites on this server, which would make searching through access logs by hand difficult.
What could be causing this? Am I just misunderstanding the way Apache reports data? Is there a better way to go about tracing the process responsible and seeing what it's actually doing?