How to set bareos-fd niceness?

35 views
Skip to first unread message

Marco Betschart

unread,
Jul 30, 2019, 2:55:33 AM7/30/19
to bareos-users
Hi @all!

I'm currently experiencing users claiming performance issues. The root cause is bareos-fd, which sometimes needs to run during work hours if something went wrong with the backup during the night. To mitigate this, I was planning to set the niceness level of bareos-fd to 10, which basically just lowers its priority.

I was thinking of:
1. Removing the symlink in /etc/systemd/system/bareos-filedaemon.service which points to /usr/lib/systemd/system/bareos-fd.service
2. Copy the original file to the symlink location
3. Add the NICE=10 setting to the copied file

While this may work, I'm wondering if theres a better way to stay update safe?

Thanks in advance,
  Marco


BTW: Talking about CentOS v7.x here.

Marco Betschart

unread,
Jul 30, 2019, 4:02:32 AM7/30/19
to bareos-users
I think I figured out an update safe way. In case anyone else needs this, here's how I solved it:

Create a new directory in the `/etc` systemd configuration folder. This directory will store our `bareos-fd` custom configuration:

$: sudo mkdir /etc/systemd/system/bareos-fd.service.d

Overwrite the default process priority by setting the Nice configuration option in a new file, stored in the created custom configuration directory:

$: sudo vi /etc/systemd/system/bareos-fd.service.d/nice.conf
# Lower the priority of bareos-fd to
# mitigate user performance issues
# in case the backup needs to run
# during work hours.

[Service]
Nice=10

Force systemd to reload its configuration files and restart bareos-fd:

$: sudo systemctl daemon-reload
$
: sudo systemctl restart bareos-fd

Check if the new niceness level of 10 is applied (it's the `NI` column):

$: ps -el | grep bareos-fd
# F S   UID   PID   PPID  C PRI  NI  ADDR SZ    WCHAN  TTY  TIME CMD
1 S     0     25701 1     0 90   10  -    44578 poll_s ?    00:00:00 bareos-fd

Dakota Pilot

unread,
Aug 8, 2019, 4:14:43 PM8/8/19
to bareos-users
You can also use systemctl edit myservice which creates the directory /etc/systmd/system/myservice as well as an override.conf file in that directory.  The override file is opened in an editor and  then you add the section and add what you need as you did.
Reply all
Reply to author
Forward
0 new messages