From bdf26c8d0046ebd008164d51ffaab0fb92ff6378 Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Tue, 22 Jan 2019 21:01:27 +0100 Subject: [PATCH] Introduce CPU and Memory resource control for php and all child-processes --- etc/systemd/system/php7.3-fpm@.service | 3 +++ etc/systemd/system/php7.3-fpm@default.service | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/etc/systemd/system/php7.3-fpm@.service b/etc/systemd/system/php7.3-fpm@.service index 8bcd303..abe64b7 100644 --- a/etc/systemd/system/php7.3-fpm@.service +++ b/etc/systemd/system/php7.3-fpm@.service @@ -26,6 +26,9 @@ BindPaths=/var/log/ BindPaths=/var/run/php/ BindPaths=/run/php/ InaccessiblePaths=/root/ +CPUQuota=100% +MemoryHigh=25% +MemoryMax=35% [Install] WantedBy=multi-user.target diff --git a/etc/systemd/system/php7.3-fpm@default.service b/etc/systemd/system/php7.3-fpm@default.service index 591faf3..a736c85 100644 --- a/etc/systemd/system/php7.3-fpm@default.service +++ b/etc/systemd/system/php7.3-fpm@default.service @@ -22,13 +22,16 @@ ProtectKernelModules=true ProtectControlGroups=true LockPersonality=true SystemCallArchitectures=native -BindPaths=/var/www/ BindPaths=/var/log/ BindPaths=/var/run/php/ BindPaths=/run/php/ BindPaths=/var/lib/php/sessions BindPaths=/var/local/squirrelmail/ +BindPaths=/var/www/ InaccessiblePaths=/root/ +CPUQuota=100% +MemoryHigh=25% +MemoryMax=35% [Install] WantedBy=multi-user.target