Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When deleting a large file, rm seems to be hogging all the available CPU and disk resources so that other program are hanging.

Is there a way to limit a programs - specifically a CPU or disk intensive program - effect on the system? Is there a way to limit its effect when deleting a large file?

share|improve this question

migrated from stackoverflow.com Apr 11 '12 at 1:16

This question came from our site for professional and enthusiast programmers.

nice (see here) is the program to do that for you. You can use renice for a running program. Note that this only does CPU, there is a corresponding ionice (see here)

share|improve this answer
GETRLIMIT(2)

NAME
       getrlimit, setrlimit, prlimit - get/set resource limits

SYNOPSIS
       #include <sys/time.h>
       #include <sys/resource.h>

       int getrlimit(int resource, struct rlimit *rlim);
       int setrlimit(int resource, const struct rlimit *rlim);
       int prlimit(pid_t pid, int resource, const struct rlimit *new_limit,
               struct rlimit *old_limit);
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .