$linuxjunkies
>

PriorityClass

also: priority class, CPUSchedulingPriority

PriorityClass is a systemd concept that groups processes into predefined priority tiers (e.g., realtime, high, normal, low, idle) to control CPU scheduling and I/O access without manually managing nice values.

PriorityClass is a systemd service configuration directive that assigns a process to a priority class, affecting how the kernel schedules its CPU time and I/O operations. Instead of using raw nice values (−20 to 19), PriorityClass provides semantic priority levels that are easier to reason about.

Common priority classes include realtime (highest), high, normal (default), low, and idle (lowest). A process set to idle only runs when the system has spare CPU cycles; one set to realtime gets preferential scheduling.

Example: A backup service in a unit file might use PriorityClass=idle to ensure it doesn't starve interactive workloads:

[Service]
PriorityClass=idle
ExecStart=/usr/bin/backup-script

PriorityClass is primarily a convenience layer in systemd that maps to underlying kernel scheduling mechanisms like nice values and cgroups, making service priorities declarative and portable.

Related terms