Find the answer to your Linux question:
Results 1 to 4 of 4
hi, i have RHL9 running as root. another user is running a shell script that gets into infinite loop and consumes almost 100% of the CPU usage. So i want ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2005
    Posts
    14

    How to restrict CPU usage??


    hi,
    i have RHL9 running as root. another user is running a shell script that gets into infinite loop and consumes almost 100% of the CPU usage. So i want to restrict the user to run such program?? If such resctrictions cannot be placed, then can i restrict the CPU usage to say 30% or 40%?
    Thanks
    Jyoti

  2. #2
    Linux Engineer
    Join Date
    Aug 2004
    Posts
    826
    This sounds very much like a homework question, but I could be wrong. Just to be safe, I'm not going to directly answer the question, but instead point you in the right direction. Here are a couple places to start:

    man nice
    man limits.conf

    /etc/security/limits.conf

    If that doesn't help, Google those terms above and/or something of the like. Those references should be enough to answer your questions though. Hope this helps.

  3. #3
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    AFAIK you can't restrict based on CPU usage but you can limit the time a process can run for - ulimit(1) is the facility, part of the shell's environment. man bash for details.

  4. #4
    Linux Engineer
    Join Date
    Aug 2004
    Posts
    826
    Quote Originally Posted by scm
    AFAIK you can't restrict based on CPU usage but you can limit the time a process can run for - ulimit(1) is the facility, part of the shell's environment. man bash for details.
    Ah, I forgot about ulimit.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •