7

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 :)

Sam Van den Eynde
  • 296
  • 1
  • 3
  • 13

1 Answers1

6
# 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
GID: N/A
DEST: group1
CONTROLLERS:
cpu
cpuset

Started the CGroup Rules Engine Daemon.
guest
  • 76
  • 2
  • Thanks, this worked for me on Ubuntu 14.04 after I did sudo apt-get install cgroup-bin cgroup-lite libcgroup1. More good info at http://frank2.net/cgroups-ubuntu-14-04/ and https://www.devinhoward.ca/technology/2015/feb/implementing-cgroups-ubuntu-or-debian – elimisteve Jan 06 '17 at 14:58