renice is the Linux command that changes the nice value of a process that is already running, which in turn changes how the kernel scheduler weighs that process against others when it distributes CPU time. Where the related nice command sets a priority at launch, renice adjusts it afterward, by process ID, process group or user.
In the management of Linux processes, renice is a low-risk, reversible tuning tool. It does not pause, kill or isolate anything; it only shifts the relative share of processor time a task receives when the CPU is contended. On an idle system, a reniced process runs exactly as fast as before.
How renice adjusts scheduling weight
renice works by calling the setpriority() system call, which writes a new nice value into the kernel’s record of the target task. Nice values range from -20 (highest priority) to 19 (lowest priority), with 0 as the default for ordinary processes. A higher number means the process is “nicer” to others and yields more CPU time.
Under the Completely Fair Scheduler and its successor, the EEVDF scheduler, each nice level maps to a load weight. Nice 0 corresponds to a weight of 1024, and every step changes the weight by roughly 25 percent, so one nice level shifts CPU share by about 10 percentage points between two competing CPU-bound tasks. The scale is multiplicative: a task at nice 0 competing with one at nice 5 receives about three times as much CPU time.
The table below shows how selected nice values translate into scheduler weights and practical effect.
| Nice value | Load weight | Practical meaning |
|---|---|---|
| -20 | 88761 | Maximum priority, reserved for critical tasks |
| -10 | 9548 | Strongly favored, needs root |
| 0 | 1024 | Default for most processes |
| 10 | 110 | Background work, yields readily |
| 19 | 15 | Runs mainly when the CPU is otherwise idle |
Because the effect is relative, not absolute, renice never guarantees a fixed percentage of CPU. A process at nice 19 still receives all available CPU time if nothing else is runnable.
renice syntax, targets and permissions
The modern util-linux form is renice -n <value> -p <pid>, where -n sets the new value (or, in some versions, an increment) and the target selector decides what is changed. Older scripts often use the positional form renice 10 1234, which still works on most distributions.
| Option | Target | Typical use |
|---|---|---|
| -p | Individual process IDs | Adjust one known task |
| -g | Process group ID | Adjust a shell pipeline or job together |
| -u | All processes of a user | Deprioritize a batch account |
Permissions follow a strict asymmetry. Unprivileged users can only raise the nice value of their own processes, which lowers priority. Lowering a nice value requires root or the CAP_SYS_NICE capability, unless the administrator grants headroom through the RLIMIT_NICE resource limit, usually configured in /etc/security/limits.conf and visible through ulimit -e.
An important detail concerns threads. On Linux, nice values are a per-thread attribute, so renice -p applied to a process ID adjusts only the thread whose ID matches it. To change every thread of a multithreaded program, administrators iterate over the thread IDs listed in /proc/<pid>/task/.
How renice compares with related priority tools
renice is one of several mechanisms that influence how a Linux process competes for resources, and each covers a different dimension. The following comparison helps choose the right tool.
| Tool | What it controls | When it applies | Scope |
|---|---|---|---|
| nice | CPU weight | At process start | One new process |
| renice | CPU weight | While running | PID, group or user |
| ionice | Disk I/O class and priority | Start or running | One process |
| chrt | Real-time policy and priority | Start or running | One process |
| taskset | CPU affinity | Start or running | One process |
| cgroups | CPU, memory and I/O quotas | Persistent | Groups of processes |
The key distinction is that renice operates only within the normal scheduling class (SCHED_OTHER, also SCHED_BATCH). Real-time tasks under SCHED_FIFO or SCHED_RR ignore nice values entirely and are managed with chrt. Where renice offers soft, proportional influence, a cgroup CPU limit imposes a hard ceiling that holds even on an idle machine.
Practical use and choosing a nice value
Administrators typically reach for renice when a long-running job is already consuming CPU and restarting it would waste work. The decision table below summarizes common situations.
| Situation | Recommended action | Reason |
|---|---|---|
| Compile job slows interactive shells | renice to 10-15 | Keeps the build running while restoring responsiveness |
| Backup script competes with a database | renice to 19 and add ionice | Backups are usually limited by disk, not CPU |
| Critical service starved under load | renice to -5 as root | Small boosts avoid starving system daemons |
| Runaway user account | renice -n 19 -u the account | Contains impact without killing sessions |
| Permanent policy needed | Use cgroups or systemd Nice= | renice changes are lost on restart |
Before acting, the current value can be read in the NI column of top or with ps -o pid,ni,comm. Inside top, the r key performs a renice interactively. Child processes inherit the nice value at fork, so reniced parents pass their priority to new children, though existing children keep their own setting.
Limitations and common mistakes with renice
renice is frequently expected to do more than it can. Its influence is limited to CPU contention, and several pitfalls catch even experienced administrators.
- No effect on an idle CPU: a reniced task runs at full speed whenever there is spare capacity.
- Disk and memory are untouched: an I/O-bound process barely slows down; ionice or cgroup I/O limits are needed instead.
- Autogroup can blunt the effect: with
CONFIG_SCHED_AUTOGROUPon desktop systems, nice values compare mainly within one session, so renicing across terminals may change little. - Irreversible for normal users: after raising a nice value, an unprivileged user cannot lower it back without RLIMIT_NICE headroom.
- Aggressive negative values are risky: renicing a heavy job to -20 can starve the shell and SSH daemon needed to recover the system.
The short version
Think of the processor as a single checkout counter and every running program as a customer. renice lets an administrator tell the cashier that a particular customer is less urgent or more urgent than before, without asking anyone to leave the line.
A program made “nicer” with renice does not stop or break. It simply steps aside more often when others need the processor. When nobody else is waiting, it still gets served at full speed. Only an administrator can move a program ahead; ordinary users can only let their own programs wait longer.
Where it makes a difference
A data engineer starts a video transcoding job on a shared eight-core Linux server that also hosts a web application. Within minutes, the transcoder saturates every core, and page response times climb from about 200 milliseconds to more than two seconds.
Restarting the job would discard forty minutes of work, so the engineer finds its process ID with pgrep ffmpeg and runs renice -n 15 -p on the main process and each of its worker threads listed under /proc. The transcoder keeps using spare CPU, but the web server’s request handlers, still at nice 0, now win most scheduling decisions.
Response times return to roughly 250 milliseconds within a minute, and the transcoding job finishes about twenty percent later than planned. The team later adds Nice=15 to the job’s systemd unit so the policy applies automatically on the next run.