From e1f6745439dba074279535f38f306a4c57b15d07 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Fri, 2 Aug 2024 13:39:32 +0300 Subject: [PATCH] Replace limits.d/00-cputime.conf with systemd/app.slice.d/90-cpulimit.conf --- etc/security/limits.d/00-cputime.conf | 8 -------- etc/systemd/system/app.slice.d/90-cpuquota.conf | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 etc/security/limits.d/00-cputime.conf create mode 100644 etc/systemd/system/app.slice.d/90-cpuquota.conf diff --git a/etc/security/limits.d/00-cputime.conf b/etc/security/limits.d/00-cputime.conf deleted file mode 100644 index d8b72171..00000000 --- a/etc/security/limits.d/00-cputime.conf +++ /dev/null @@ -1,8 +0,0 @@ -# TODO: I don't think I understand cpu time properly and I don't feel -# qualified to judge how to restrict it. These numbers are taken from -# "man limits.conf", although they were swapped and they didn't originally -# blanket apply to asterisk. -# My goal here would be workaround difficult Matrix clients and compliment -# systemd-oomd, which handles the memory management. -* soft cpu 5000 -* hard cpu 10000 diff --git a/etc/systemd/system/app.slice.d/90-cpuquota.conf b/etc/systemd/system/app.slice.d/90-cpuquota.conf new file mode 100644 index 00000000..a2c346fa --- /dev/null +++ b/etc/systemd/system/app.slice.d/90-cpuquota.conf @@ -0,0 +1,7 @@ +# This file is intended to restrict all apps to 180 % CPU of dualcore, in +# hopes of preventing system freezing to that. Memory is handled by +# systemd-oomd. +[Slice] +CPUAccounting=true +CPUQuota=180% +# vim: filetype=systemd