LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Cgroups, restricting memory (https://www.linuxquestions.org/questions/linux-software-2/cgroups-restricting-memory-4175445067/)

e64462 01-10-2013 08:14 PM

Cgroups, restricting memory
 
Dear friends,

I'm on ubuntu 12.10, trying to configure cgroups to restrict memory usage on a per-application basis. Basically I have some programs that are unimportant in nearly every concievable way, but which I still need running in the background---and they're using more physical memory than I want them to, so i'd like to either:

a) relegate them to a swapfile (I have no swap partition)
b) make less memory available for them to use.

Everything I've found suggests that cgroups is the only path for me to take at this moment, and I've been trying for days but can't make any progress.

My basic steps have been:
Code:

sudo apt-get install cgroups-bin
editing /etc/cgroups.conf to contain
Code:

group limited {
  memory {
    memory.limit_in_bytes = 1024M;
  }
}

and then rebooting. But on reboot, the cgroup 'limited' doesn't exist in /sys/fs/cgroup/memory. This is sort of expected because most guides and instructions on the internet suggest that /etc/cgroups.conf is created when installing cgroups, but this was not the case for me on 12.10, I had to create the file myself.

The documentation is so poor on this subject, and I don't understand it all that well to begin with, so your assistance is greatly appreciated!

Best
e

syg00 01-11-2013 02:20 AM

The best doco, since before it was even called cgroups has been in the kernel source tree. Start here, and read the cgroups.txt followed by memory.txt.


All times are GMT -5. The time now is 04:51 AM.