Truelite / nspawn-runner

Custom gitlab runner based on systemd-nspawn
GNU General Public License v3.0
21 stars 4 forks source link

systemd-nspawn memory and cpu accounting #12

Closed kapouer closed 2 years ago

kapouer commented 2 years ago

While rebuilding a lot of packages, one container exhausted all memory available and was killed. Nobody wants that on a server, so here are some additional systemd-nspawn options to consider:

 "--property=MemoryAccounting=yes", "--property=MemoryHigh=30%", "--property=MemoryMax=40%",
"--property=CPUAccounting=yes", "--property=CPUWeight=50"

I like how one can set a percentage of physical memory. There are more similar options here, but i don't see the point: https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html