3 ms·
> Tangent, but the 2nd point is intriguing. How does one use cgroups to set up resource limitations? Is there any kind of decent front-end? I've seen the kernel
by mseepgood 13y ago
> Tangent, but the 2nd point is intriguing. How does one use cgroups to set up resource limitations? Is there any kind of decent front-end? I've seen the kernel documentation, but how do I use it?
Use systemd: http://0pointer.de/blog/projects/resources.html http://0pointer.de/blog/projects/resources.html
Systemd makes these kernel features finally usable.
- _delirium 13y agoThat looks interesting for some use-cases, but I don't see a way to use it to assign limits to users, or to processes that aren't started as systemd services. What I have in mind is that I give someone ssh access, they run R or matlab or from the command line, but limited to 512mb (or 1Gb or whatever) of total memory.
- WestCoastJustin 13y agoOn RHEL systems you can use the 'cgred' service to classify processes based on the user running it or the command itself. For example, say you have user X who always logs in and runs rsync commands and saturates the link. You can automatically classify this user or rsync process into a cgroup that throttles the network IP (or in your use case, memory) -- problem solved. There is some great documentation @ https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html-single/Resource_Management_Guide/index.html#The_cgred_Service https://access.redhat.com/site/documentation/en-US/Red_Hat_E...
- viraptor 13y agoIt's not RHEL-specific. Ubuntu and pretty much everything that includes cgroups tools has it.
- shykes 13y agoYou could build a matlab docker container and limit memory with 'docker run -m 512M delirium/matlab' :) See http://docker.io http://docker.io
- hdevalence 13y agoYou're in luck; this specific usecase is documented on the Arch Wiki: https://wiki.archlinux.org/index.php/cgroups#Matlab https://wiki.archlinux.org/index.php/cgroups#Matlab