Very High Apache CPU On Simple Processes

My Apache server is at a standstill with connections maxed out and CPU usage at 500%. It has been working fine for months but something today made it go weird. Very very simple Apache processes are taking up large amounts of CPU:

Srv PID Acc M   CPU SS  Req Conn    Child   Slot    Client  VHost   Request
0-0 31154   0/45/45 R   23.85   3   1   0.0 0.47    0.47    ?   ?   ..reading..
0-0 31154   0/36/36 _   24.66   0   1   0.0 0.43    0.43    81.152.251.175  mysite.net  GET /css/dwn.css    HTTP/1.1
0-0 31154   0/33/33 R   23.92   2   179 0.0 0.69    0.69    ?   ?   ..reading..
0-0 31154   0/1/1   W   0.07    119 0   0.0 0.00    0.00    117.102.163.190 mysite.net  POST    /includes/offers/ajax.php   HTTP/1.1
0-0 31154   1/64/64 C   24.74   0   1   26.8    1.85    1.85    24.127.122.188  mysite.net  GET /images/soc.png HTTP/1.1
0-0 31154   0/51/51 _   24.87   0   899 0.0 0.78    0.78    86.111.144.194  mysite.net  GET /includes/offers/window.php?file=57860&tooltip=true HTTP/1.
0-0 31154   0/18/18 R   11.00   77  1   0.0 0.27    0.27    ?   ?   ..reading..

As you can see, simple ..reading.. and requests like GET /images/soc.png HTTP/1.1 are taking up 24.5+ amounts of CPU. I am wondering if it is some sort of logging bug where the server is trying to handle huge log files. Let me know what you guys think about this.

Answer

The sample you proceed was small but I have seen similar things before. it might not actually be the web server that’s the problem, take look further upstream to something like the database. Is the DB reached max-connections or taking flogging?

if you have a lot of processes caught in send reply state you can see similar symptoms such as this..

> 0-0 31154   0/1/1   W   0.07    119 0   0.0 0.00    0.00   
> 117.102.163.190 mysite.net  POST    /includes/offers/ajax.php   HTTP/1.1

note the Seconds since beginning of most recent request (SS) times are high on your “send reply state” (W).

Attribution
Source : Link , Question Author : kmoney12 , Answer Author : AngryWombat

Leave a Comment