mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 16:43:05 +02:00
21 lines
801 B
SYSTEMD
21 lines
801 B
SYSTEMD
|
|
[Unit]
|
||
|
|
Description=Resource-capped slice for user monitoring / status-bar scripts
|
||
|
|
Documentation=https://www.freedesktop.org/software/systemd/man/systemd.slice.html
|
||
|
|
|
||
|
|
[Slice]
|
||
|
|
# Cap the entire slice at 50% of one CPU and 512 MiB of RAM. If i3blocks or
|
||
|
|
# any other status-bar tooling enters a fork-storm regime (as was observed
|
||
|
|
# when polling scripts forked awk/tr/grep/bc every tick), the kernel will
|
||
|
|
# throttle the slice rather than let it eat the box.
|
||
|
|
CPUQuota=50%
|
||
|
|
# MemorySwapMax=0 is required on systems with zram: without it, a cgroup
|
||
|
|
# hitting MemoryMax thrashes zram instead of being OOM-killed, freezing
|
||
|
|
# the machine. See .github/skills/oom-prevention/SKILL.md.
|
||
|
|
MemoryMax=512M
|
||
|
|
MemorySwapMax=0
|
||
|
|
TasksMax=256
|
||
|
|
|
||
|
|
# Make sure killing the slice reaps every descendant.
|
||
|
|
[Install]
|
||
|
|
WantedBy=default.target
|