Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

add comment

2 Answers 2

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
add comment
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.