LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > How to Limit 10% Cpus for LiteSpeed PHP ?

Reply
 
Thread Tools Display Modes
  #1  
Old 05-30-2010, 11:01 PM
dk.mmmm dk.mmmm is offline
Member
 
Join Date: May 2010
Posts: 20
Default How to Limit 10% Cpus for LiteSpeed PHP ?

I want to Limit 10% Cpus for lsphp5 , how to ?
Reply With Quote
  #2  
Old 05-30-2010, 11:34 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
"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.
Reply With Quote
  #3  
Old 05-31-2010, 01:01 AM
dk.mmmm dk.mmmm is offline
Member
 
Join Date: May 2010
Posts: 20
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.
Reply With Quote
  #4  
Old 05-31-2010, 01:17 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
did it limit lsphp5 10% cpu successfully?

how many cpu cores on your server?

usually how many lsphp5 processes are running?
Reply With Quote
  #5  
Old 05-31-2010, 01:23 AM
dk.mmmm dk.mmmm is offline
Member
 
Join Date: May 2010
Posts: 20
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.
Reply With Quote
  #6  
Old 05-31-2010, 01:31 AM
dk.mmmm dk.mmmm is offline
Member
 
Join Date: May 2010
Posts: 20
Can you tell me

Application name of LiteSpeed is :

ls or lsphp5 or something ?
Reply With Quote
  #7  
Old 05-31-2010, 01:35 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
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.
Reply With Quote
  #8  
Old 05-31-2010, 01:36 AM
dk.mmmm dk.mmmm is offline
Member
 
Join Date: May 2010
Posts: 20
thanks your help.

I found out, cpulimit only limit process run by SSH. Can't limit Web Process

thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:38 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.