How to Limit 10% Cpus for LiteSpeed PHP ?

NiteWave

Administrator
#2
"cpulimit is a simple program that attempts to limit the cpu usage of a process (expressed in percentage, not in cpu time). This is useful to control batch jobs, when you don't want them to eat too much cpu. It does not act on the nice value or other scheduling priority stuff, but on the real cpu usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly"
-->
http://cpulimit.sourceforge.net/

Please try yourself if it works for lsphp5.
 
#3
I have tried it.

When I try: cpulimit -e lsphp5 -l 10

It show waiting proccess running. While my website have a lot visitor.

Because lsphp5 is running under nobody group.
 
#5
My Cpus is 4 cores.

After I use:
cpulimit -e lsphp5 -l 10

It show "Warning: no target process found. Waiting for it..."

I think it because I use ROOT, and LiteSpeed is nobody.

However, when I use ps -e , it show a lot lsphp5 are running.
 

NiteWave

Administrator
#7
if you have 4 cores, at least limit to 4 X 10%=40%. since full CPU usage is 400%, not 100%

using top instead of ps can see which processes use CPU most

from the message "Warning: no target process found. Waiting for it...", it looks like cpulimit not working as expected.
 
Top