I am looking for a consistent way to configure cgroups on a Ubuntu 14.04 Desktop system with limited resources.

What I would like to do:

  • create a few groups with limited memory and cpu assigned for specific tasks
  • auto-enable these groups on reboot
  • assign certain commands/programs to each group

I understand cgroup configuration, and how to start processes for a specific group using cgexec. The problem is the next step.

I have build a working /etc/cgconfig.conf file, that I am able to parse and activate successfully using cgconfigparser to get configured cgroups. However this is as far as I get.

  • I don't find a service to read and parse /etc/cgconfig.conf correctly on system boot. The current cgroup packages don't seem to include such a service.
  • As I understand /etc/cgconfig.conf is accompanied by a /etc/cgrules.conf file, that described how processes are started by default in a certain group. I can't identify the service or mechanism that parses it. Without this functionality I need to start all processes using cgexec to get them in a cgroup.

I have tried to use cgmanager, but that service does not seem to configure from /etc/cgconfig.conf either. In general I find the information how to configure and use cgroups on Ubuntu Desktop systems hard to locate.

So, is anybody able to point me in the right direction? What service do I need to install, and what config files does it obey?

Just to be clear: I am not looking for containers. It is to structure resource handling on a single dedicated system.

Many thanks :)

# vi /etc/cgrules.conf
tomcat7:wkhtmltopdf cpu,cpuset  group1

# cgrulesengd -d -v -f /var/log/cgrulesengd.log &
# cat /var/log/cgrulesengd.log
CGroup Rules Engine Daemon log started
Current time: Thu Jan 15 16:04:20 2015

Opened log file: /var/log/cgrulesengd.log, log facility: 0, log level: 7
Proceeding with PID 28569
Rule: tomcat7:wkhtmltopdf
UID: 500
DEST: group1

Started the CGroup Rules Engine Daemon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.