mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-14 19:57:00 +05:30
systemd: Cap resource usage for all services
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
4e44394ee6
commit
9a506ec776
7 changed files with 28 additions and 0 deletions
|
@ -24,6 +24,10 @@ ReadWriteDirectories=/etc/ssl/caddy
|
||||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||||
NoNewPrivileges=true
|
NoNewPrivileges=true
|
||||||
|
CPUWeight=10
|
||||||
|
CPUQuota=10%
|
||||||
|
IOWeight=20
|
||||||
|
MemorySwapMax=0
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -17,6 +17,10 @@ Restart=always
|
||||||
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
|
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
|
||||||
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||||
#AmbientCapabilities=CAP_NET_BIND_SERVICE
|
#AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||||
|
CPUWeight=20
|
||||||
|
CPUQuota=25%
|
||||||
|
IOWeight=20
|
||||||
|
MemorySwapMax=0
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -16,6 +16,10 @@ TimeoutStopSec=5s
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=true
|
PrivateDevices=true
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
CPUWeight=10
|
||||||
|
CPUQuota=10%
|
||||||
|
IOWeight=20
|
||||||
|
MemorySwapMax=0
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -16,6 +16,10 @@ TimeoutStopSec=5s
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=true
|
PrivateDevices=true
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
CPUWeight=10
|
||||||
|
CPUQuota=10%
|
||||||
|
IOWeight=20
|
||||||
|
MemorySwapMax=0
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -15,6 +15,10 @@ TimeoutStopSec=5s
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=false
|
PrivateDevices=false
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
CPUWeight=10
|
||||||
|
CPUQuota=10%
|
||||||
|
IOWeight=20
|
||||||
|
MemorySwapMax=0
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -15,6 +15,10 @@ TimeoutStopSec=5s
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=false
|
PrivateDevices=false
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
CPUWeight=10
|
||||||
|
CPUQuota=10%
|
||||||
|
IOWeight=20
|
||||||
|
MemorySwapMax=0
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -15,6 +15,10 @@ TimeoutStopSec=5s
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=false
|
PrivateDevices=false
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
CPUWeight=10
|
||||||
|
CPUQuota=10%
|
||||||
|
IOWeight=20
|
||||||
|
MemorySwapMax=0
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue