execute the program with different priority:
nice -n [19 to -20] program
-n 0 — standard priority
-n 19 — lowest priority
-n -20 — highest priority
change already running program priority:
renice -n [19 to -20] -p PID
renice -n [19 to -20] -u user
change IO priority:
ionice -c [1 to 3] -n [19 to -20] command or program
ionice -c 2 -n 7 cat /var/logs/some.log
or with process:
ionice -c2 -n7 -p PROCESS(PID)
-c means class of IO priority:
-c 1: Real-time. The highest IO priority can interrupt the operating system’s normal behavior.
-c 2: Best effort. The default class of priority, nice and renice will do the work with the second class of IO priority.
-c 3: Idle. The process will get IO only when no other process is using the drives.
more info: man-page ionice(1)