Web Hosting Talk







View Full Version : httpd takes 10% CPU


Katt
05-31-2002, 11:33 AM
My server became overloaded today

9:17am up 1 day, 7:07, 1 user, load average: 4.34, 5.80, 5.68
455 processes: 448 sleeping, 7 running, 0 zombie, 0 stopped
CPU states: 70.8% user, 5.5% system, 0.0% nice, 23.6% idle
Mem: 1028456K av, 1003716K used, 24740K free, 1352K shrd, 202500K buff
Swap: 1024088K av, 604K used, 1023484K free 509552K cached

I notice some httpd processes take more that 10% CPU.
Is this normal?
How to reduce the load without decreasing the performance?

allan
05-31-2002, 01:40 PM
We would need more information. If you have a server-status page set up you can tell the number of requests that were cokming into the server, that would help determine if the CPU usage is simply because there are a lot of requests -- or because of something else.

In addition some modules, like mod_gzip or mod_perl, can add to the HTTP CPU usage, but this increase in CPU usage offsets CPU a potentially larger CPU usage if those modules were not installed.

Katt
05-31-2002, 07:25 PM
uuallan,

Thank you for you answer.

Unfortunately I don't have such a page and don't know how to set up one :(

In fact there are some perl scripts that are running on the server but I try to start them one by one not to overload it.
May be there needs to be done some perl optimization.
I set MaxRequestsPerChild to 100 if this helps at all.

Would you recommend me an online guide how to do it or describe it here if it is not that hard.

I am a total newbie at linux and perl and am having difficulties understanding it. So please try to put it simple :)

Thanks again!!!

Katt
06-03-2002, 02:09 PM
HELPPPPPPPPPPPPPPPPPP!!!!!!!!!!!!!!!!!!!!!!!!!
It's getting worse


11:55am up 4 days, 9:45, 1 user, load average: 37.46, 27.89, 29.95
507 processes: 453 sleeping, 54 running, 0 zombie, 0 stopped
CPU states: 90.0% user, 10.0% system, 0.0% nice, 0.0% idle
Mem: 1028456K av, 1023348K used, 5108K free, 1352K shrd, 130292K buff
Swap: 1024088K av, 652K used, 1023436K free 530088K cached

Katt
06-03-2002, 02:14 PM
Now the SMTP has stopped working and won't start.
Please heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp

allan
06-03-2002, 02:20 PM
Take a look at this, and see if it helps:

http://www.linux-mag.com/2001-03/tech_support_03.html

The important thing is to find out which site on the server is causing these the CPU usage.

Katt
06-03-2002, 04:37 PM
I reduced Minspareserver and Startservers to 32
Maxspareservers to 64
and Maxclients to 512
But it didn't help much
SMTP still can't start

2:28pm up 2:11, 1 user, load average: 25.54, 19.70, 24.35
441 processes: 410 sleeping, 31 running, 0 zombie, 0 stopped
CPU states: 87.7% user, 7.3% system, 0.0% nice, 4.9% idle
Mem: 1028456K av, 964340K used, 64116K free, 1352K shrd, 104648K buff
Swap: 1024088K av, 0K used, 1024088K free 600004K cached

Katt
06-03-2002, 05:33 PM
Is it normal to have more than 30 processes running simultaneously?
How to reduce the number of processes running?

allan
06-03-2002, 08:56 PM
What error do you get when you try to start SMTP?

Were you able to determine which site/what pages were generating the traffic?

Katt
06-04-2002, 04:39 AM
I have at least 50 processes like this
apache 10088 0.2 0.8 15232 8980 ? S 00:07 0:18 /usr/sbin/httpd -f /etc/httpd/conf/httpd_app.conf -DSSL -DSSL.d
and lots of log processes:
root 4155 0.0 0.0 1516 416 ? S Jun03 0:00 /usr/local/sbin/cronolog /home/virtual/site44/fst/var/log/httpd

The problem with ps -aux is that I can't see anything that eats more than 1% CPU and every time on Top there is at least one 7-15% httpd

Katt
06-04-2002, 04:41 AM
btw, I managed to start the smtp but cut the timouts to 5 secs and the average loads now are below 10