4 ms·
A plug: I wrote a process launcher that uses cgroups to set a per process limit for memory and swap use (that was before Docker). It was for an online game ser
by geoka9 9y ago
A plug: I wrote a process launcher that uses cgroups to set a per process limit for memory and swap use (that was before Docker).
It was for an online game service; the challenge was to run multiple instances of the game app on the cluster with minimal latency for the users, but also to make sure that no user could hog server resources by spawning multiple instances of the game.
https://github.com/geokat/cgfy https://github.com/geokat/cgfy
- loeg 9y agoThanks! I use cgroups (manually) to memory constrain applications that I know leak memory (e.g., rtorrent, chrome at one time). This looks like a nice way of making that a bit less manual.
- nerpderp83 9y agoWhen they hit a threshold, send them a check point event and kill and restart. Too bad chrome didn't thundering heard so hard when it comes back to life.
- geoka9 9y agoNo problem. I've just checked and it looks like libcgroup is not maintained any more and fallen behind the cgroups development. This may work instead: systemd-run --scope -p MemoryMax=4M rtorrent You can also set other quotas - `man systemd.resource-control` for more info.