renice: change scheduler priority of a running process
Alters processes to run with another priority
Typical usage: job execution, performance tuning, system administration, troubleshootingIntroduction 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 system | Package name | Installation |
---|---|---|
AlmaLinux | coreutils |
|
Arch Linux | coreutils |
|
Debian | coreutils |
|
Fedora | coreutils |
|
Red Hat Enterprise Linux | coreutils |
|
Rocky Linux | coreutils |
|
openSUSE | coreutils |
|
Ubuntu | coreutils |
|
Your Linux distribution using a different package? Share your feedback.
Usage
Available options
Long option | Short option | Description |
---|---|---|
--priority PRIORITY | -n | Defines 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] | -g | Define the process group IDs for which the priority will be changed |
--pid PID [PID2] [PID3] | -p | Define the process IDs for which the priority will be changed, normally this is the default option |
--user USER [USER2] [USER3] | -u | Define 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:
Command | Category | Summary |
---|---|---|
basename | files | Strips directory and file name suffix from a given path |
chrt | processes | Sets Linux scheduler policy and priority for a process or command |
kill | processes | Sending signals to processes |
nice | processes | Runs commands with specified priority |
numactl | processes | Controls NUMA policy for processes and shared memory |
peekfd | processes | Tracks a process and show file descriptor activity |
pidof | processes | Returns process IDs for a process name |
pidstat | monitoring | Monitoring CPU, memory, and disk activity |
pidwait | processes | Wait for process to stop |
pmap | processes | Shows memory mapping of process |
prtstat | processes | Shows process details for selected process like state, CPU and memory usage |
pscap | capabilities | Display available capabilities for running processes |
pslog | logging | Shows which log files a process has opened |
pstree | processes | Show active processes and children like a tree |
pwdx | processes | Shows current working directory of a process |
slabtop | memory | Shows slab usage of kernel |
smem | memory | Show memory usage including swap |
strace | process inspection | Inspects running process |
units | data conversion | Converts a unit into another one, like from Celcius to Fahrenheit |
watch | processes | Monitors changes in output of specified command |