Page 1 of 1

httpd taking 100% of CPU!

PostPosted: 03. October 2011 19:57
by rollex
Hi,

I have been trying to find a solution for my problem, but only found help for XAMPP for Windows. I'm using lampp and have not found anything related to my problem, not from this forum and not by googleing.

I'm using openSUSE 11.4. These have not helped so far:

- Disabling firewall (I don't use susewall at all, I use only denyhosts but it has nothing to do with apache right?)
- /opt/lampp/lampp restart - as soon as apache is restarted, httpd process spawn again 100%!
- Rebooting computer - as soon as apache is restarted, httpd process spawn again 100%!
- Editing Win32DisableAcceptEx to /opt/lampp/etc/httpd.conf but I guess this is Windows thing because apache won't start if I add this
- Checking out scripts - nothing would indicate any errors
- Updated from 1.7.4 to 1.7.7 just now and it went fine. No effect on this problem!

How to debug this and what is causing this? It has been continuing very long time, but it does not seem to affect in the system functionality. Like it shows up 100%, but it's not? I'm so confused...

EDIT: Oh and the picture from my conky setup:
Image

Re: httpd taking 100% of CPU!

PostPosted: 03. October 2011 23:03
by JonB
have you looked at your logfiles???

maybe httpd IS that busy :shock:

just a thought
8)

Re: httpd taking 100% of CPU!

PostPosted: 04. October 2011 11:09
by rollex
How can it be all the time, 24/7 for days and weeks straight without any pause in CPU stats? It's always 100%, definitely not normal. access_log seem pretty big, figuring it out now... no clue in other logs.

Re: httpd taking 100% of CPU!

PostPosted: 04. October 2011 11:21
by JonB
First question -

Is the machine unresponsive? At those levels is should be at least 'slow' to serve pages.

I'm not seeing much in the way of transfers - so that is weird. Nor is your memory being eaten up.

There are a couple of other possible explanations -

One very simple explanation would be 'the tool is the problem'.

Its also possible you have some code that loops endlessly.

Definitely weird, I'll agree.

Good Luck
8)

Re: httpd taking 100% of CPU!

PostPosted: 04. October 2011 11:27
by rollex
JonB wrote:Its also possible you have some code that loops endlessly.


Thanks for the tip! It was one of my php/ajax scripts that looped... access_log told about it. disabling the script solved the problem! No, the machine was normally functioning, no other problems than httpd filling up process logs. This case is now solved, remember always to check your scripts ;)

Re: httpd taking 100% of CPU!

PostPosted: 04. October 2011 15:04
by JonB
Glad it is fixed -

BUT -
remember always to check your scripts


really should be

Always remember to check your logfiles :lol:


Good Luck
8)

Re: httpd taking 100% of CPU!

PostPosted: 05. October 2011 00:06
by americanimage
I completely agree! I had an issue with a script a while ago that was causing the same looping type error, and honestly the logfile (even though it should have been first) was at least an hour into troubleshooting.

Course, when your up and coding at 4am with no sleep, sometimes an outsider's perspective REALLY helps! That, sleep, and coffee. :)