vorta
vorta copied to clipboard
Provide setting to run scheduled backups with a lower CPU priority
The problem
I use my machine mostly for things that require a lot of computing power. Whenever a backup is running, there is a noticeable delay in the work I do.
Requested Solution
I was wondering if a setting could be implemented that would allow the user to choose whether they want to lower the CPU priority for backup jobs. Like borgmatic does in the systemd service file:
[...]
# Lower CPU and I/O priority.
Nice=19
CPUSchedulingPolicy=batch
IOSchedulingClass=best-effort
IOSchedulingPriority=7
IOWeight=100
Restart=no
# Prevent rate limiting of borgmatic log events. If you are using an older version of systemd that
# doesn't support this (pre-240 or so), you may have to remove this option.
LogRateLimitIntervalSec=0
# Delay start to prevent backups running during boot. Note that systemd-inhibit requires dbus and
# dbus-user-session to be installed.
ExecStartPre=sleep 1m
ExecStart=systemd-inhibit --who="borgmatic" --what="sleep:shutdown" --why="Prevent interrupting scheduled backup" /root/.local/bin/borgmatic --verbosity -2 --syslog-verbosity 1
Yes, we could implement adjusting the niceness for borg processes. As always you are welcome to open a PR, I can guide you through solving this FR.
Hi @real-yfprojects I'd like to work on this. Can you guide me how to go about this?
Assigned you. But please suggest your high level solution first. The systemd way above won't work for Mac for example. So this would be implemented per-OS like the network stuff.