8 comments

[ 2.6 ms ] story [ 31.0 ms ] thread
Thanks Mats! I've been looking for something like this for a while.
Shameless plug: I needed to run multiple instances of a binary while limiting the memory footprint (memory + swap) for each instance, so I wrote a launcher that achieves this by placing the process in its own cgroup.

May be useful as a "production" example of libcgroup usage.

https://github.com/geokat/cgfy/blob/master/cgfy.c

It's useful! Thank you for your example.
My knee jerk was to assume that this was a reinvention of cgexec.

You had me at "limiting already running process to cpu 30%".

My poor laptop has never loved a feature so much as this.

ありがとう, Matsumoto-san.

Besides that this is a very cool little tool I think it's also notable for being written in MRuby. MRuby is a dialect or Ruby designed for embedded devices, but can be used for system tools as well. The biggest difference is that MRuby is compiled, so you end up with a static binary like this project.

The language is still the dynamic dispatching dream that is Ruby, so it might not be the fastest language, but it is a nice alternative for Go for system tools.