100 % cpu usage debian 32 bit due to apache processes

3

So there is a VPS with openvz virtualization, with debian 6.0 32 bit The problem is appearing approx. 1 week ago. The automatic security monitoring system is shutting down the vps that i'm running due to cpu overload! I am linking the /etc/apache2/apache2.conf

If you could help somehow without access then thank's in advance! If you need more files then please ask and i will try to post them!

rsz

Posted 2012-08-23T15:57:41.497

Reputation: 143

@rsz This was bumped to home page by the system.... Did you see the answer on this post already? Did it help? Don't forget to tick the gray check mark to the upper left of the answer which does help resolve to turn it green and to indicate that is the answer that helped you the most for your question. Otherwise, consider letting people know the status of this question and what further may be needed, etc. – Pimp Juice IT – 2019-11-30T03:33:55.503

@PimpJuiceIT hey, Well, this was a very long time ago. I can't remember what the solution was or if I found it in these answers. I can't accept an answer in good belief because it may be misleading. I am usually accepting answers that helped me or pointed me in the right direction. Thanks for the notice :) What do you suggest as next steps for this question? – rsz – 2019-12-02T18:46:25.320

In this case based on the feedback, I'm not sure. Maybe just leave it as-is or ask a mod or someone else. I just wanted to be sure you didn't miss it I suppose. – Pimp Juice IT – 2019-12-02T18:57:18.323

show us output of netstat -patn while high CPU usage will be observed. Also a top output would be useful. Are you using X of some sort? like gnome or KDE or is it only console accessed server? What kind of hardware do you have? CPU / RAM – mnmnc – 2012-08-23T16:04:29.053

it is only console access 1 vcpu 2GHZ 2GB RAM 25GB SSD – rsz – 2012-08-23T16:09:44.400

ok. if you type in the console top you will see column CPU% it will show you the usage percentage per process that particular process is using. show us top 10 or top 15 of those processes. – mnmnc – 2012-08-23T16:14:08.570

okay i am waiting until the cpu is on 100% – rsz – 2012-08-23T16:21:45.177

80 will be totaly enough. – mnmnc – 2012-08-23T16:22:21.723

top output netstat -patn output UPDATE> htop output UPDATE2: another top output – rsz – 2012-08-23T16:39:28.660

Well, no mystery there. you need to limit the number of clients in apache config and number of threads. I would cut it by two and see if it will work stable. you have currently: ThreadLimit 64

MaxClients 80 – mnmnc – 2012-08-23T16:46:40.790

Answers

0

Change the config by limiting possible clients and threads:

ThreadLimit          40
MaxClients           40

If it will help - OK. If not - cut it more.

I can see in netstat output that a lot of connections are originated from one IP address. This might mean that your site is poorly constructed - for example lots of iframes - each one of them will generate a thread on your side. You might want to redesign the site. Also check how big is your site and if you got a lot of pictures in hight definition and so on... Think about free cloud cache services like cloudflare.com it might free your CPU a bit.

mnmnc

Posted 2012-08-23T15:57:41.497

Reputation: 3 637

remember to run apache2ctl restart after changes. – mnmnc – 2012-08-23T17:00:03.337