aboutsummaryrefslogtreecommitdiffstats
path: root/systemd
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-12 21:00:53 +0100
committerMax Kellermann <max@duempel.org>2014-02-12 21:00:53 +0100
commit5a486a940c069e3e9cafd7061c3d7b714ce9877e (patch)
treeda97c27f6dac16ce64097544be7dd3e8bfd12643 /systemd
parentd05ae4b4447644d17a30416e7b62c75a50c31356 (diff)
downloadmpd-5a486a940c069e3e9cafd7061c3d7b714ce9877e.tar.gz
mpd-5a486a940c069e3e9cafd7061c3d7b714ce9877e.tar.xz
mpd-5a486a940c069e3e9cafd7061c3d7b714ce9877e.zip
systemd: assign real-time budget
Diffstat (limited to 'systemd')
-rw-r--r--systemd/mpd.service.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/systemd/mpd.service.in b/systemd/mpd.service.in
index 65fffa7bb..a72eb925c 100644
--- a/systemd/mpd.service.in
+++ b/systemd/mpd.service.in
@@ -5,5 +5,18 @@ After=network.target sound.target
[Service]
ExecStart=@prefix@/bin/mpd --no-daemon
+# allow MPD to use real-time priority 50
+LimitRTPRIO=50
+LimitRTTIME=-1
+
+# move MPD to a top-level cgroup, as real-time budget assignment fails
+# in cgroup /system/mpd.service, because /system has a zero real-time
+# budget; see
+# http://www.freedesktop.org/wiki/Software/systemd/MyServiceCantGetRealtime/
+ControlGroup=cpu:/mpd
+
+# assign a real-time budget
+ControlGroupAttribute=cpu.rt_runtime_us 500000
+
[Install]
WantedBy=multi-user.target