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.

I am having a problem with Apache2 spawning processes that use 100% CPU.

Attaching strace to one of such processes produces no output sometimes and sometimes gives this:

2672  17:18:07 poll([{fd=14, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
2672  17:18:07 write(14, "\236\3\0\0\3SELECT FLOOR(((price_index."..., 930) = 930
2672  17:18:07 read(14, "\1\0\0\1\2\33\0\0\2\3def\0\0\0\5range\0\f?\0\r\0\0\0\10\0"..., 16384) = 85

I would be grateful for any ideas as to interpreting the above.

share|improve this question
1  
Are you running php? Is the strace made when the proces was using 100% CPU? What is recorded in the access log at the same time? Do you have an apache status page? Are you using compression, keep-alive, caching, mysql? –  Mircea Vutcovici Nov 14 '11 at 19:13
    
Yes, Magento to be precise. Yes, strace is being attached while the process is at 100% CPU. –  knef Nov 15 '11 at 7:49
    
Yes to MySQL, yes to keep-alive, no errors in log files, no compression. Status is disabled but I'll try it now. I now have a sneaking suspicion that this is related to a recent security update to Apache (USN-1259-1) –  knef Nov 15 '11 at 7:55
    
It is interesting also the access log. Try to find out for which URL apache will use 100% CPU for long time (5 seconds for a response should be considered long these days). –  Mircea Vutcovici Nov 15 '11 at 18:14

1 Answer 1

There is nothing crime. From the your output some script (mb php) create sql qury to db. You can crete much more info with using -s flag. E.g:

strace -pPID -s1024 > /tmp/mysql.pid.strace 2>&1
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.