How to use set-property or cgroups.
Cgroups - kernel control group:
we can set memory High on sshd:
How to use:
systemctl set-property sshd.service MemoryHigh=2G
server:~ # systemctl restart sshd
server:~ # systemctl status sshd
● sshd.service - OpenSSH Daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system.control/sshd.service.d
└─50-MemoryHigh.conf
Active: active (running) since Mon 2023-10-02 07:39:29 CEST; 2s ago
Process: 1995 ExecStartPre=/usr/sbin/sshd-gen-keys-start (code=exited, status=0/SUCCESS)
Process: 1997 ExecStartPre=/usr/sbin/sshd -t $SSHD_OPTS (code=exited, status=0/SUCCESS)
Main PID: 1998 (sshd)
Tasks: 1
CGroup: /system.slice/sshd.service
└─ 1998 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
please check this file:
server~ # cat /etc/systemd/system.control/sshd.service.d/50-MemoryHigh.conf
# This is a drop-in unit file extension, created via "systemctl set-property"
# or an equivalent operation. Do not edit.
[Service]
MemoryHigh=2147483648
Žiadne komentáre:
Zverejnenie komentára