Running a nightly backup script on a server system, such as a web hosting server, can result in a heavy load and longer latency for other processes, for example, HTML or .php pages load slowly during the backup because the backup script requires too many I/O or CPU resources.
On Linux systems, two shell utilities are available to set I/O and CPU scheduling for an application or script. The utilities are named nice and ionice.
Reduce the I/O priority of the /usr/local/bin/backup.sh script so that it does not interfere with other processes:
/usr/bin/ionice -c2 -n7 /usr/local/bin/backup.sh
The -n parameter must be between 0 and 7, where lower numbers mean higher priority.
To reduce the CPU priority, use the command nice:
/usr/bin/nice -n 19 /usr/local/bin/backup.sh
The -n parameter can range from -20 to 19, where lower numbers mean higher priority
Nice and ionice can also be combined, to run a script at low I/O and CPU priority:
/usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /usr/local/bin/backup.sh
The post Reduce CPU and Disk load of backup scripts with nice and ionice appeared first on FAQforge.
One of the most critical gaps in traditional Large Language Models (LLMs) is that they…
Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…
What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…
Wouldn’t it be wonderful to wake up one day with a desire to explore AI…
Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…
Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…