Este conteúdo não está disponível no idioma selecionado.
Chapter 38. Setting the priority for a process with the chrt utility
You can set the priority for a process using the chrt
utility.
Prerequisites
- You have administrator privileges.
38.1. Setting the process priority using the chrt utility Copiar o linkLink copiado para a área de transferência!
The chrt
utility checks and adjusts scheduler policies and priorities. It can start new processes with the desired properties, or change the properties of a running process.
Procedure
To set the scheduling policy of a process, run the
chrt
command with the appropriate command options and parameters. In the following example, the process ID affected by the command is1000
, and the priority (-p
) is50
.chrt -f -p 50 1000
# chrt -f -p 50 1000
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To start an application with a specified scheduling policy and priority, add the name of the application, and the path to it, if necessary, along with the attributes.
chrt -r -p 50 /bin/my-app
# chrt -r -p 50 /bin/my-app
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more information about the
chrt
utility options, see The chrt utility options.
38.2. The chrt utility options Copiar o linkLink copiado para a área de transferência!
The chrt
utility options include command options and parameters specifying the process and priority for the command.
Policy options
- -f
-
Sets the scheduler policy to
SCHED_FIFO
. - -o
-
Sets the scheduler policy to
SCHED_OTHER
. - -r
-
Sets the scheduler policy to
SCHED_RR
(round robin). - -d
-
Sets the scheduler policy to
SCHED_DEADLINE
. - -p n
Sets the priority of the process to n.
When setting a process to SCHED_DEADLINE, you must specify the
runtime
,deadline
, andperiod
parameters.For example:
chrt -d --sched-runtime 5000000 --sched-deadline 10000000 --sched-period 16666666 0 video_processing_tool
# chrt -d --sched-runtime 5000000 --sched-deadline 10000000 --sched-period 16666666 0 video_processing_tool
Copy to Clipboard Copied! Toggle word wrap Toggle overflow where
-
--sched-runtime 5000000
is the run time in nanoseconds. -
--sched-deadline 10000000
is the relative deadline in nanoseconds. -
--sched-period 16666666
is the period in nanoseconds. -
0
is a placeholder for unused priority required by thechrt
command.
-