How to lower the priority of program / script / process in Debian / Linux

Nice utility allows you to change the priority in the performance of the processor. ionice – changes the priority for I / O operations.
Program Format nice:
# Nice -n “degree of priority” Commando
“Degree of priority” – the number from -20 (highest priority in the process) to 19 (lowest priority in the process).
Format ionice:
# Ionice -c class -n “priority” Commando
“Classes”:
* 1 (Real time);
* 2 (Best Effort) – class is the default for all processes;
* 3 (Idle).
priority – a number from 0 to 7 (lower – higher priority).
For example, you need to change the priority of backup script on the server in the crown:
January 10 * * * nice -n 15 ionice -c2 -n7 /home/user/backup-script.sh
Or in the script used to change the priority of the program:
# Nice -n 15 ionice -c2 -n7 tar cfz /home/site/backup.tar.gz / home / user / data / www / site / *

Leave a Reply

Your email address will not be published. Required fields are marked *