Commit 9f7b6729 authored by Evangelos Foutras's avatar Evangelos Foutras 🐱
Browse files

Merge branch 'limit-borg-cpu-on-single-vcpu-servers' into 'master'

Limit Borg CPU usage on single vCPU servers to 50%

See merge request archlinux/infrastructure!447
parents 2039efbe f5b566fa
......@@ -57,12 +57,14 @@
template: src=backup-gitlab.sh.j2 dest=/usr/local/bin/backup-gitlab.sh owner=root group=root mode=0755
when: inventory_hostname == "gitlab.archlinux.org"
- name: install systemd timer and service for backup
copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
- name: install systemd services for backup
template: src={{ item }}.j2 dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
with_items:
- borg-backup.timer
- borg-backup.service
- borg-backup-offsite.service
- name: activate systemd timers for backup
- name: install systemd timer for backup
copy: src=borg-backup.timer dest=/etc/systemd/system/borg-backup.timer owner=root group=root mode=0644
- name: activate systemd timer for backup
systemd: name=borg-backup.timer enabled=yes state=started daemon-reload=yes
{% if ansible_processor_vcpus == 1 %}
{# Limit CPU usage to avoid triggering a HostHighCpuLoad alert #}
CPUQuota=50%
{% endif %}
......@@ -5,4 +5,5 @@ Description=Borg backup (offsite)
Type=oneshot
Restart=on-failure
RestartSec=5m
{% include 'borg-backup-cpu-quota.j2' %}
ExecStart=/usr/local/bin/borg-backup-offsite.sh
......@@ -7,4 +7,5 @@ Before=borg-backup-offsite.service
Type=oneshot
Restart=on-failure
RestartSec=5m
{% include 'borg-backup-cpu-quota.j2' %}
ExecStart=/usr/local/bin/borg-backup.sh
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment