renice: change scheduler priority of a running process

Alters processes to run with another priority

Typical usage: job execution, performance tuning, system administration, troubleshooting

Introduction into renice

The renice tool is a command-line tool on Linux similar to command, except that it changes the priority of running processes. It can change the priority for multiple processes based on their process ID, process group ID, or even the user or users. This may help when a single process or multiple processes of a particular user are causing issues. Another option is that a particular task is taking too much time and needs more priority, where the system administrator then can decide to give that process more priority.

Installation

When renice is not installed by default, it can be added to the system using the relevant software package.

Package information for renice

Operating systemPackage nameInstallation
AlmaLinuxcoreutils
dnf install coreutils
Arch Linuxcoreutils
pacman -S coreutils
Debiancoreutils
apt install coreutils
Fedoracoreutils
dnf install coreutils
Red Hat Enterprise Linuxcoreutils
dnf install coreutils
Rocky Linuxcoreutils
dnf install coreutils
openSUSEcoreutils
zypper install coreutils
Ubuntucoreutils
apt install coreutils

Your Linux distribution using a different package? Share your feedback.

Usage

Available options

Long optionShort optionDescription
--priority PRIORITY-nDefines the new priority (-20 is highest, 19 lowest) for process, process group, or a user. When defined, it needs to be the first argument after the command.
--pgrp GROUPID [GROUPID2] [GROUPID3]-gDefine the process group IDs for which the priority will be changed
--pid PID [PID2] [PID3]-pDefine the process IDs for which the priority will be changed, normally this is the default option
--user USER [USER2] [USER3]-uDefine the user ID or username for which the priority is to be changed and can also be multiple users

Missing an option in this overview? Share your feedback.

Examples using renice

Changing priority by PID

Changes running process ID 552 to the lowest priority

renice 19 -p 552

Output: 552 (process ID) old priority 5, new priority 19

Change back the priority of, shortened notation (PID is default)

renice 0 552

Output: 552 (process ID) old priority 19, new priority 0

Changing priority by user

Give more priority to all processes of user www-data

renice -10 -u www-data

Output: 33 (user ID) old priority 0, new priority -10

Frequently Asked Questions

What is the renice command and its purpose?

The renice command is a command-line tool to change the priority of running processes.

Which package provides the renice command?

The command renice is provided by the coreutils package.

Related and similar commands

Linux has a lot of tools and commands available and sometimes you just need that little other tool. Here is a list of commands that are similar or related to renice:

Related and similar commands to renice
CommandCategorySummary
basenamefilesStrips directory and file name suffix from a given path
chrtprocessesSets Linux scheduler policy and priority for a process or command
killprocessesSending signals to processes
niceprocessesRuns commands with specified priority
numactlprocessesControls NUMA policy for processes and shared memory
peekfdprocessesTracks a process and show file descriptor activity
pidofprocessesReturns process IDs for a process name
pidstatmonitoringMonitoring CPU, memory, and disk activity
pidwaitprocessesWait for process to stop
pmapprocessesShows memory mapping of process
prtstatprocessesShows process details for selected process like state, CPU and memory usage
pscapcapabilitiesDisplay available capabilities for running processes
pslogloggingShows which log files a process has opened
pstreeprocessesShow active processes and children like a tree
pwdxprocessesShows current working directory of a process
slabtopmemoryShows slab usage of kernel
smemmemoryShow memory usage including swap
straceprocess inspectionInspects running process
unitsdata conversionConverts a unit into another one, like from Celcius to Fahrenheit
watchprocessesMonitors changes in output of specified command