Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide setting to run scheduled backups with a lower CPU priority #1752

Open
daPhipz opened this issue Jul 14, 2023 · 3 comments
Open

Provide setting to run scheduled backups with a lower CPU priority #1752

daPhipz opened this issue Jul 14, 2023 · 3 comments
Assignees
Labels
help wanted This issue is available, comment if you want to fix it type:enhancement Improvement of an existing function

Comments

@daPhipz
Copy link

daPhipz commented Jul 14, 2023

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
@real-yfprojects
Copy link
Collaborator

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 real-yfprojects added type:enhancement Improvement of an existing function help wanted This issue is available, comment if you want to fix it labels Aug 13, 2023
@shivansh02
Copy link
Collaborator

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

@m3nu
Copy link
Contributor

m3nu commented Mar 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted This issue is available, comment if you want to fix it type:enhancement Improvement of an existing function
Projects
None yet
Development

No branches or pull requests

4 participants