Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Do you have an unusual high number of requests that could saturate your disks? Do you get messages about read errors in the syslog? What about the memory? Is it possible the system is swapping all the time? –  Sven Aug 13 '13 at 20:03
    
Memory has stayed at about 30% so seems to be fine. I don't think its swapping. Which syslog file do I check? –  hellohellosharp Aug 13 '13 at 20:09
    
Please provide your httpd.conf file, I can see all threads are using same PID which could lead to a limitation on number of child processes per thread. Also as you mentioned your server is stuck trying to read that could indicate a problem trying to fetch some data from a database that is not responding, however this could also indicate there is a problem on your configuration and you should adjust requests TTL. –  mdiianni Aug 15 '13 at 15:33

2 Answers 2

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).

share|improve this answer

Please provide your httpd.conf file, I can see all threads are using same PID which could lead to a limitation on number of child processes per thread. Also as you mentioned your server is stuck trying to read that could indicate a problem trying to fetch some data from a database that is not responding, however this could also indicate there is a problem on your configuration and you should adjust requests TTL. This can be done at php level if you want.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.