3

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?

2 Answers 2

5

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)

0
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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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