MRatWork Forum by Mustafa Ramadhan
Sawo Project - Kloxo-MR Discussions => Kloxo-MR Development => Topic started by: Spacedust on 2014-02-17, 21:06:24
-
Is this possible ?
We have some customers using more than 300% of 8 threads :/
-
Use cgroups and create group only for these clients.
We use it for apache, because sometimes apache use more than 600% cpu and everything freeze...
-
Use cgroups and create group only for these clients.
We use it for apache, because sometimes apache use more than 600% cpu and everything freeze...
I use some anti overload scripts when load is getting too high ex. 70 or more than apache and all php-fpm processes are killed to prevent server freeze :) I leave it on screen to check each second.
-
:D If we kill apache and fpm all customers will start call us :D
Thats why we use cgroups for all these process. eg, Apache, nginx, qmail, fpm, mysql
Yes sometimes its slower than usual but it is stable.
-
@insanity, could you give a detailed description on how to setup cgroups for Apache, or whatever process, how to add users to that group, etc.
-
Yes, i would be interested to test out resource limiting by cgroups as well.
IIRC, cgroups is indeed used by LInux containers :)
-
He is using probably CloudLinux which I hate.
-
What about https://www.rfxn.com/projects/system-priority/ ?. Look like very simple.
-
Actually i'm not using cloudlinux. Only cgroups
Its simple. Install cgroups: yum install libcgroup
Here is my limit for apache:
/etc/cgconfig.conf
mount {
cpuset = /cgroup/cpuset;
cpu = /cgroup/cpu;
cpuacct = /cgroup/cpuacct;
}
group apache {
cpu {
cpu.cfs_quota_us="25000";
cpu.cfs_period_us="10000";
}
cpuacct {
cpuacct.usage="0";
}
cpuset {
cpuset.cpus="0,1,2,3,4,5,6,7";
}
}
/etc/cgrules.conf
apache cpu,cpuacct,cpuset apache/
/etc/init.d/cgconfig start
/etc/init.d/cgred start
This conf limit my apache at 250% and allow to use 8 cpu cores
-
Good idea, but I think it's a bit useless. I do not wan't to limit Apache itself but to lock some users from hogging all my CPU power.