Reduce CPU usage of a process

I’ve schedule backintime to backup my home dir once an hour. The problem is, when the backup process starts the system becomes sluggish. I’ve found that the process is launched from a crontab:

cat /var/spool/cron/$USER
#Back In Time system entry, this will be edited by the gui:
0 * * * * /usr/bin/nice -n19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime backup-job >/dev/null

I’m guessing that ionice is used to give a priority to the process. How can I modify this to reduce cpu/disk usage?

nice is for the process, ionice is for input/output. The higher the value, the “nicer” ─ i.e. the lower the priority ─ the process becomes.

man nice
man ionice


1 Like

It would appear the priorities are already set for low values. I wonder if the sluggishness I’m seeing is physical. I backup to an old-school spinner, at the same time I stream media from the same drive.

Yep, that is definitely bound to slow down your system. The heads will be moving back and forth all the time because it has to stream and it has to write the backup. And there’s only so much throughput you can get from a single drive, and especially a spinning rust drive. :man_shrugging:

Just to clarify and add to @Aragorn’s comment , the man pages say you increase the value in order to decrease the priority. Sorry if this is what you’ve already checked, but it’s not clear to me from what you’ve written.

You can install Ananicy,its do exactly what you do for nice procesess but automatically,its in aur as ananicy-git.

If you want to add a program that ananicy doesn’t know yet,you can add a rule file in the /etc/ananicy.d/00-default/ folder with the process name and what type of ananicy configuration should apply.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.