systemd: Cap resource usage for all services

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
Harsh Shandilya 2019-09-10 20:59:04 +05:30
parent 4e44394ee6
commit 9a506ec776
No known key found for this signature in database
GPG key ID: C2E74282C2133D62
7 changed files with 28 additions and 0 deletions

View file

@ -24,6 +24,10 @@ ReadWriteDirectories=/etc/ssl/caddy
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
CPUWeight=10
CPUQuota=10%
IOWeight=20
MemorySwapMax=0
[Install]
WantedBy=multi-user.target

View file

@ -17,6 +17,10 @@ Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_BIND_SERVICE
CPUWeight=20
CPUQuota=25%
IOWeight=20
MemorySwapMax=0
[Install]
WantedBy=multi-user.target

View file

@ -16,6 +16,10 @@ TimeoutStopSec=5s
PrivateTmp=true
PrivateDevices=true
ProtectSystem=full
CPUWeight=10
CPUQuota=10%
IOWeight=20
MemorySwapMax=0
[Install]
WantedBy=multi-user.target

View file

@ -16,6 +16,10 @@ TimeoutStopSec=5s
PrivateTmp=true
PrivateDevices=true
ProtectSystem=full
CPUWeight=10
CPUQuota=10%
IOWeight=20
MemorySwapMax=0
[Install]
WantedBy=multi-user.target

View file

@ -15,6 +15,10 @@ TimeoutStopSec=5s
PrivateTmp=true
PrivateDevices=false
ProtectSystem=full
CPUWeight=10
CPUQuota=10%
IOWeight=20
MemorySwapMax=0
[Install]
WantedBy=multi-user.target

View file

@ -15,6 +15,10 @@ TimeoutStopSec=5s
PrivateTmp=true
PrivateDevices=false
ProtectSystem=full
CPUWeight=10
CPUQuota=10%
IOWeight=20
MemorySwapMax=0
[Install]
WantedBy=multi-user.target

View file

@ -15,6 +15,10 @@ TimeoutStopSec=5s
PrivateTmp=true
PrivateDevices=false
ProtectSystem=full
CPUWeight=10
CPUQuota=10%
IOWeight=20
MemorySwapMax=0
[Install]
WantedBy=multi-user.target