PDA

View Full Version : limit cpu load


payne
20th May 2007, 15:28
is there any program or tool to limit cpu load per virtual host?

Leszek
20th May 2007, 15:40
Hi!

I see this is a very similar question to the one I wanted to ask yesterday so I'll just stick to this thread.Here's mine:

I was just wondering how to limit the server's load in general,for ex.don't let the server be loaded above 80%.I mean the CPU load.
Can it be done by PAM (/etc/security/limits.conf) ?

And the second thing.

Sometimes it happens that certain sites that use Php and MySQL generate high loads and slow things down.I'd like to know how to automatically turn them off so the load would get lower.

payne
20th May 2007, 20:00
i googled and found usefull topic http://www.directadmin.com/forum/showthread.php?threadid=1650

falko
21st May 2007, 12:54
Hi!

I see this is a very similar question to the one I wanted to ask yesterday so I'll just stick to this thread.Here's mine:

I was just wondering how to limit the server's load in general,for ex.don't let the server be loaded above 80%.I mean the CPU load.
Can it be done by PAM (/etc/security/limits.conf) ?

And the second thing.

Sometimes it happens that certain sites that use Php and MySQL generate high loads and slow things down.I'd like to know how to automatically turn them off so the load would get lower.
Take a look at monit: http://www.howtoforge.com/server_monitoring_with_munin_monit_debian_etch
You can tell it to stop certain services if the load gets too high. :)

Leszek
22nd May 2007, 16:35
Munin is installed on my system.I guess it will turn the service back on after the load would get lower.But how about certain sites ?

And one more thing:limiting memory with for example:


if totalmem > 500 MB for 5 cycles then restart

doesn't seem to work because it returns an error (old part of the syslog):
May 26 14:58:20 server monit: /etc/monit/monitrc:38: Warning: TOTALMEMORY statement does not work properly on Linux 'MB'.
Can it be done in some other way ?

falko
23rd May 2007, 12:51
doesn't seem to work because it returns an error (old part of the syslog):
.
Can it be done in some other way ?
I had that on my systems, too. The only thing that helped is to comment out the totalmem line... :(