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 use Ubuntu 6.06.2 LTS with Server version: Apache/2.0.55; built:Aug 16 2010 18:25:39 and PHP 5.1.2 (cli) (built: Sep 16 2010 20:32:18). All my 4 Cores are constantly at 100% and the system begins to accumulate load. A restart for apache fixes the problem temporarily. I made a strace to the pid of the apache processes that keep the CPU busy. I get the following message continuously:

gettimeofday({1285234145, 989639}, NULL) = 0

Do you have any ideas where this problem comes from?

Thank you.

UPDATE: The problem came from an application error that generated an infinite loop. Thank you all for your great help.

share|improve this question
add comment

2 Answers

If apache use threading mpm use flag -f to strace

And use flag -c

#strace -fcp 1268
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
  -nan    0.000000           0         4         1 read
  -nan    0.000000           0         1           write
  -nan    0.000000           0         1           open
  -nan    0.000000           0         2           close
  -nan    0.000000           0        18           gettimeofday
  -nan    0.000000           0         1           munmap
  -nan    0.000000           0         1           writev
  -nan    0.000000           0         2           poll
  -nan    0.000000           0         1           mmap2
  -nan    0.000000           0         2           stat64
  -nan    0.000000           0         6           fcntl64
  -nan    0.000000           0        29        25 futex
  -nan    0.000000           0         1           accept
  -nan    0.000000           0         1           getsockname
  -nan    0.000000           0         1           shutdown
------ ----------- ----------- --------- --------- ----------------
100.00    0.000000                    71        26 total

gettimeofday very simple call. The problem is something else.

share|improve this answer
1  
When i run strace on the faulty process i get only this: 196941 gettimeofday. Any ideas why? –  pincoded Sep 23 '10 at 11:16
    
do you use -f flag –  bindbn Sep 23 '10 at 12:00
    
yes, i did strace -fcp but only the gettimeofday is shown for the faulty apache processes. for sane processes the output is similar with your. can i some see what files does apache access when the process gets corruted? thanks. –  pincoded Sep 23 '10 at 12:29
add comment

I've had this problem before as well, but, having troubles remembering what it was. I have a vague thought that it may have been something with a module apache was loading. Perhaps PHP, Zend Optimizer/Ion Cube.

I would check Ion Cube and where you are loading it... it makes a difference which order it is loaded in and I'm fairly certain I've seen 100% CPU load issues with it (move it to where the other zend_extension settings are and comment out the apache.d/ioncube.conf entry).

I'm obviously assuming you're using IonCube or Zend Optimizer, but, perhaps try disabling them and starting apache again to see if the 100% CPU load issue happens.

share|improve this answer
    
Thank you for your answer but it's not the case, im not running IonCube or Zend Optimizer. Do you have any other idea how can i find the root of this problem? –  pincoded Sep 23 '10 at 11:55
    
"6.06.2 LTS". Are you able to update/upgrade the system/software? I think 6.06.2 is a little old now. Also, when did this start? Was a site added or any modifications? –  Imo Sep 23 '10 at 12:19
    
This started yesterday. Yes i am able to update/upgrade and i did so, but the problem still persists. No site was added or modified, only some html/php scripts were updated. Thanks. –  pincoded Sep 23 '10 at 12:28
    
How many sites on there? Can you temporarily disable the site that the changes were made to and see if Apache runs normally? Or, roll back some of the changes (PHP) to see if they introduced the problem? Hopefully that would narrow the problem down a bit? –  Imo Sep 23 '10 at 12:36
    
Thank you for the suggestion. Im thinking to make this tonight when the activity is low to minimize the impact for the clients. –  pincoded Sep 23 '10 at 12:42
show 6 more comments

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.