I have a CentOS server I am testing things out on.
In it, I have configured
USERNAME hard maxlogins 4
USERNAME hard cpu 1
USERNAME hard nproc 10
in /etc/security/limits.conf
and
USERNAME hard maxlogins 4
USERNAME hard cpu 1
USERNAME hard nproc 10
in /etc/security/limits.d/90-nproc.conf
Have also set a /etc/init.d script
with the following
cpulimit -l 10 /usr/sbin/mysqld &
cpulimit -l 10 /usr/bin/php &
yet, when I run
ab -n 2000 -c 100 http://USERNAME.com/
and watch top -c
I can see that they all get ignored, and end up with 150+ USERNAME
, mysqld spikes out around 30%, and php for each USERNAME
hits about 2-3% each
How can I set this up properly to limit maxlogins, cpu, nproc for USERNAME
, and how is it that mysqld is still punching past that 10% mark?