nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Limit CPU usage for process Red Hat

This is a discussion on Limit CPU usage for process Red Hat within the CentOS / RHEL / Fedora forums, part of the Linux Distribution category; Hello, I have been researching the ability to limit a cpu usage amount to processes on a rhel server. e.g. ...


Go Back   nixCraft Linux Forum > Linux Distribution > CentOS / RHEL / Fedora

Linux answers from nixCraft.


CentOS / RHEL / Fedora Discussion about Redhat Enterprise Linux or CentOS or Fedora Linux related problems.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 28-10-2009, 12:26 AM
jaysunn's Avatar
Powered By Linux
User
 
Join Date: Apr 2009
Location: 41.332032,-73.089775
OS: RHEL - OSX
Scripting language: BASH - Learning Ruby
Posts: 600
Thanks: 61
Thanked 78 Times in 70 Posts
Rep Power: 10
jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold
Default Limit CPU usage for process Red Hat

Hello,

I have been researching the ability to limit a cpu usage amount to processes on a rhel server.

e.g.

php scripts can only consume 20% of the cpu. If it crosses that threshold the process will be terminated. As well as httpd processes, they are limited to a certain percentage of the cpu.

I have been looking up making changes to:

limits.conf
php.ini

Has anyone had to cross this bridge before? I can use some feedback on the correct approach to this.


Thanks,

Jaysunn
__________________
Have a look at what I have been working on
http://www.shellasaurus.com
Reply With Quote
  #2 (permalink)  
Old 28-10-2009, 09:32 AM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 708
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
Default

limits.conf only limit cpu in minutes or seconds.Take a look at nice, ulimit and renice command. There is no config option that can limit 20% php cpu usage. However, a perl or php scrip can monitor usage and kill process if CPU >= 20%.
__________________
Rocky Jr.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
  #3 (permalink)  
Old 28-10-2009, 07:26 PM
jaysunn's Avatar
Powered By Linux
User
 
Join Date: Apr 2009
Location: 41.332032,-73.089775
OS: RHEL - OSX
Scripting language: BASH - Learning Ruby
Posts: 600
Thanks: 61
Thanked 78 Times in 70 Posts
Rep Power: 10
jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold
Default

Yes,

I am actually working on a perl script to do just that. Thank you very much for your reply.

I will be sure to post it when it is complete.
Jaysunn
__________________
Have a look at what I have been working on
http://www.shellasaurus.com
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Bandwidth Limit with Iptables please CentOS / RHEL / Fedora 3 15-02-2010 07:02 PM
How to group the output w/ limit alvingo Shell scripting 1 26-07-2009 05:45 PM
list path for apache process with great cpu usage cosminnci Shell scripting 4 19-08-2008 02:21 AM
CPU usage Shell script (Monitoring CPU Usage) atulmatkar Shell scripting 2 10-05-2008 10:24 PM
Killing of a process and send a mail if the process doesnot come up within 2 minutes Prince89 Shell scripting 1 11-02-2008 12:39 PM


All times are GMT +5.5. The time now is 11:19 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38