Forrest logo
back to the ionice tool

ionice:tldr:3fa12

ionice: Set I/O scheduling class of a running process.
$ ionice -c ${scheduling_class} -p ${pid}
try on your machine

The ionice command is used to set or get the I/O scheduling class and priority for a process. It allows you to control the input and output (I/O) priority of a process, which can be helpful in managing system resources and improving performance.

The command has two options:

  1. -c ${scheduling_class}: This option is used to set the I/O scheduling class. The ${scheduling_class} represents the scheduling class you want to assign to the process. The available classes are:

    • 0 or none: No scheduling class (default).
    • 1 or realtime: Real-time scheduling class, which gives the highest priority to the process.
    • 2 or best-effort: Best-effort scheduling class (default for most processes).
    • 3 or idle: Idle scheduling class, which gives the lowest priority to the process.

    By specifying the scheduling class, you can determine how the process's I/O operations are prioritized.

  2. -p ${pid}: This option is used to specify the process ID (PID) of the target process for which you want to set or get the I/O priority. The ${pid} represents the PID of the process.

By combining these options, the ionice command allows you to set the I/O scheduling class and priority for a specific process. For example, if you want to set the scheduling class to "best-effort" and adjust the priority of a process with PID 1234, you would use the command:

ionice -c 2 -p 1234
This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ionice tool