Discussion in 'General' started by dk.mmmm, May 31, 2010.
I want to Limit 10% Cpus for lsphp5 , how to ?
"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"
Please try yourself if it works for lsphp5.
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.
did it limit lsphp5 10% cpu successfully?
how many cpu cores on your server?
usually how many lsphp5 processes are running?
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.
Can you tell me
Application name of LiteSpeed is :
ls or lsphp5 or something ?
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.
thanks your help.
I found out, cpulimit only limit process run by SSH. Can't limit Web Process
Separate names with a comma.