vorta icon indicating copy to clipboard operation
vorta copied to clipboard

Provide setting to run scheduled backups with a lower CPU priority

Open daPhipz opened this issue 2 years ago • 3 comments

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

daPhipz avatar Jul 14 '23 11:07 daPhipz

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.

real-yfprojects avatar Aug 13 '23 13:08 real-yfprojects

Hi @real-yfprojects I'd like to work on this. Can you guide me how to go about this?

shivansh02 avatar Mar 02 '24 21:03 shivansh02

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.

m3nu avatar Mar 04 '24 07:03 m3nu