Linux cgroups (control groups) allow limiting and accounting for resources on a system, including CPU, memory, and block I/O.

learn more… | top users | synonyms

3
votes
1answer
30 views

cgroups/systemd: How to create a cgroup for a process tree [non-root]

As a non-root user, I'd like to be able to start a process that will start a bunch of other processes (think of a 'make' session, or the way Google Chrome starts a process for each tab) and have the ...
1
vote
0answers
50 views

Systemd: stop the main process (or the service) when a subprocess crash

I have two programs that I called program1 and program2 which perform a main task of two operations. When program1 start running it pipe its results to program2 which performs the final result. ...
2
votes
0answers
27 views

Limiting users ram with cgroups not working (for me)

I registred because I didn't manage running cgroups with several tutorials/comments/whatever you find on google. I want to limit the amount of ram a specifix user may use. Internet says "cgroups". My ...
1
vote
0answers
18 views

How to delete a device parameter for a cgroup?

Values of a specific parameter (for example, blkio.throttle.write_bps_device) for all devices are stored in a single file. echo "$MAJOR:$MINOR $LIMIT" > blkio.throttle.write_bps_device inserts/...
1
vote
1answer
36 views

httpd process status systemctl output

Can some explain the last portion of this output ( The line starting with CGROUP and all the following lines): systemctl status httpd -l httpd.service - The Apache HTTP Server Loaded: loaded (/...
1
vote
0answers
24 views

How to limit/monitor a cgroup process's blkio when process has output redirection

I have some questions on cgroup blkio controller. I want to limit the IOPS on a specific process. This process uses IO redirection to write the stdout contents into a file. I tried to put the ...
3
votes
0answers
18 views

“leaky bucket” style disk io throttling using linux kernel

My goal is to prevent one kvm guest's disk i/o usage from negatively affecting other kvm guests on the same host. The host has one disk array - and separating guests onto different physical disks is ...
1
vote
1answer
31 views

Virtualbox memory not reflected in its cgroup

I've trying to limit the amount of memory a user can use using cgroups (using Ubuntu 16.04 with systemd). After setting the MemoryLimit property of user-.slice I can see the change reflected in its ...
1
vote
1answer
197 views

What are the “cpu” and “memory” options on the mount command?

I found some mount commands in a shell script: mount -t cgroup -o memory none /path/XXX mount -t cgroup -o cpu none /path/XXX The question is what does the cpu/memory option mean? I search the ...
1
vote
1answer
51 views

mkdir under /cgroup creates files along with directories

All this while I have been thinking that mkdir can only create directories. But I am surprised to see that it was able to create files also under some conditions. I recently started working with ...
0
votes
1answer
39 views

vagrant user able to switch to any user without any password while running command “sudo su - <username>” but other users doesn't

I have installed two vagrant hosts on my machine. I login using user/pass: vagrant/vagrant Created a user user1. When I am in vagrant user and type below command : [vagrant@host1]sudo su - I am ...
1
vote
1answer
84 views

cgconfig.conf file is missing

I installed cgroup on my linux (3.19.0+) using the following command: apt-get install cgroup-bin However I can't find the file /etc/cgconfig.conf. Did I miss anything?
0
votes
1answer
35 views

My systemd slices aren't reporting info to systemd-cgtop

I have a centos VM running via KVM on my Debian laptop. This is what I see when I run systemd-cgtop: I know I have a user,system,and machine slice, but I'm only seeing data from the machine slice. ...
3
votes
1answer
53 views

Cgroups Memory Related Questions

1) Why cgroup is showing more number of tasks than actual number of tasks.? Ex : [root@localhost proc]# ps -aux | wc -l 421 [root@localhost proc]# cat /sys/fs/cgroup/memory/tasks | wc -l 539 2) ...
1
vote
0answers
51 views

Does high Load average cgroups give “wrong” overall load average

Assume you have a system with 2 processors. Now create a cgroup and configure this group to use only 1 processor. Populate it with enough processes to give it a load average of 5 (to prove a point); ...
0
votes
1answer
150 views

Cannot set memory.memsw.limit_in_bytes in cgroup on Ubuntu server using cgm

I'm trying to limit resource usage for a cgroup without having root access. I can set memory.limit_in_bytes using cgm setvalue memory memory.limit_in_bytes 150G But I can not set memsw....
7
votes
0answers
88 views

Get quota usage information as non-privileged user

I have non-privileged access to a Linux server (shared PHP+MySQL hosting) and there are disk space, memory, CPU usage, I/O quotas. I wonder how can I get information about max/current quota usage ...
3
votes
1answer
156 views

Centos 6 to Centos 7 cgroups

I'm trying to set up resource limits per user in Centos 7, but I can't find the right commands for the new implementation of cgroups (I did read the documentation but it talks about restricting ...
12
votes
1answer
699 views

How to use cgroups to limit all processes except whitelist to a single CPU?

There is a guide to cgroups from Red Hat which is maybe sort of kind of helpful (but doesn't answer this question). I know how to limit a specific process to a specific CPU, during the command to ...
0
votes
1answer
258 views

Why cgroup cpu items are miss in Debian 8

the kernel version for debian 8 use 3.10. But under /sys/fs/cgroup/cpu, miss a lot of cpu items. vagrant@debian-jessie:/sys/fs/cgroup/cpu$ ls -1 . cgroup.clone_children cgroup.procs cgroup....
4
votes
1answer
173 views

Using tc for traffic quotas?

Is it possible to implement traffic quotas (absolute limits, not rate limits) based on the network classifier cgroup? I see there is the iptables netfilter 'quota' extension, which seems to do ...
0
votes
1answer
161 views

How to limit Skype CPU usage

I use Skype only for messaging. But it is consuming some CPU time when idle. So, I need to limit only one process and only for the CPU usage. Can that be done easily? I am a complete newbie to Linux ...
2
votes
0answers
79 views

cgroups: cgclassify processes of other users

As root I've create a cgroup which limits cpu and memory usage. cgcreate -g cpu,memory:matlab_sandbox cgset -r cpu.shares=250 matlab_sandbox cgset -r memory.limit_in_bytes=8G matlab_sandbox Now I'm ...
2
votes
0answers
78 views

What is “state-object” in cgroups

I am gathering some idea about lxc, kernel name spaces and cgroups. While reading man lxc-cgroup, i find : lxc-cgroup gets or sets the value of a state-object (e.g., 'cpuset.cpus') in the ...
4
votes
1answer
324 views

Permanent swapping with lots of free memory

We have a Linux server running Debian 4.0.5 (Kernel 4.0.0-2) with 32G RAM installed and 16G Swap configured. The system uses lxc containers for compartmentalisation, but that shouldn't matter here. ...
11
votes
1answer
102 views

How do cgroups interact with non-cgrouped processes?

I have 3 processes on a single core machine. Each process is exactly the same and burns CPU as fast as it can (tight loop). Two of them (A and B) are launched with cgexec in separate groups with ...
1
vote
0answers
161 views

How to set a process’s sched method to fifo and priority when cgroup are on?

I’m using CentOS 6.6, I want to set the sched method of my kvm VM to FIFO with priority 1. First, I use chrt and get error: chrt(): "failed to set pid XXX's policy" I find here: chrt(): "...
1
vote
1answer
21 views

Configure scheduling to a program

The program "checking" should be autostart when the machine boot and should be start always with scheduling round robin with priority 27 in Rhel/Centos 7. I can configure this scheduling with cgroups ...
3
votes
0answers
87 views

Sandboxing a binary on linux

I am trying to understand various options I have to restrict/sandbox a binary in Linux. I see that I can use namespaces and cgroups like docker does. I could use SELinux like this link suggests. Which ...
0
votes
1answer
203 views

How do I read from memory.pressure_level in a cgroup?

I want to see the memory pressure of the cgroup. But simple cat memory.presure_level fails. How do I know the current memory pressure of a cgroup?
3
votes
1answer
555 views

Linux cgroups: limit CPU usage in absolute values which do not depend on CPU speed

I have a server with a 2.4GHz processor. And there are several cgroups, each one allowed to use 25% of CPU. That's equal to 600MHz. Then I replace the CPU with a faster one, let's say 3.0GHz. If I ...
1
vote
0answers
109 views

cgroup memory.usage_in_bytes always zero for some tasks

I am trying to use cgroup to manage memory on a HPC cluster using torque queue manager on CentOS 6 machines. Just to test I login to a node running a job where I have: pbs_mom(12184)─┬─sh(24312)───...
0
votes
1answer
2k views

High on %wa from top command, is there any way to constrain it?

Here's my last top info before it stucks: top - 18:26:10 up 238 days, 5:43, 3 users, load average: 1782.01, 1824.47, 1680.36 Tasks: 1938 total, 1 running, 1937 sleeping, 0 stopped, 0 zombie ...
1
vote
1answer
365 views

How to ensure ssh via cgroups on centos?

When some cpu-intensive processes are running on the server, chances are that we could not log in to this machine with error 'operation timeout' via ssh command. According to this post answered by ...
1
vote
1answer
104 views

Systemcrash suexec forkbomb.sh ulimits

I got this script named fork.sh: #!/bin/sh forkbomb() { forkbomb | forkbomb & } ; forkbomb If I call it through suexec my whole system will consume 99% cpu. To prevent a normal bash forkbomb I ...
1
vote
0answers
297 views

Using Cgroups with Systemd to restrict bash cpu & memory

I want to restrict every user on my Centos 7 server who is logged in via SSH. They should not be able to use, for example, a forkbomb and kill the whole system. The superuser will have no restriction. ...
1
vote
0answers
64 views

Why my limit on CPU does not validate via cgroups

/etc/cgconfig.conf ... group memlimit { memory { memory.limit_in_bytes = 8589934592; } } group cpulimit { cpu { cpu.shares = 1024; } } /etc/cgrules.conf: @...
1
vote
0answers
29 views

A way to set parameters in the LXC parent cgroups

So I have LXC installed, guest containers configured and all. The LXC containers each go into their own submodule (in cgroup parlance) and each are configured with cpu.shares and also the memory they'...
0
votes
0answers
113 views

LINUX processes are forking up to thousand of processes again, even after kill command

On one of our boxes, I'm encountering strange problem from time to time.. in.tftpd processes are forking up to thousand of processes, getting server to almost unresponsive state. I've tried various ...
3
votes
0answers
197 views

Limit system processes using cgroups

My server runs several dozens of processes that are not in my control (mostly monitoring software). According to my application logs, sometimes some of the third party processes try to allocate too ...
0
votes
1answer
299 views

ubuntu lts and cgroup support in iptables [closed]

I don't understand why Ubuntu community built iptables without cgroup support and what I don't understand if community didn't make it? Maybe Ubuntu use another some way (iptables without cgroup etc)? ...
7
votes
2answers
200 views

Does managing cgroups require root access?

I am trying to work with control groups on two different operating systems (Ubuntu and CentoOS). There are few concerns that I would like to ask. I am trying to create a control group using the ...
1
vote
1answer
31 views

Adding entire session to a cgroup

How would I add entire session to a cgroup. cgclassify seems to add just the specified PID.
1
vote
1answer
154 views

Distributing CPU cores between cgroups and outside world

Is it possible to manage access to CPU cores in a similar fashion that memory limiting works? In particular I need to be able to dynamically create and destroy cgroups that will limit a particular ...
12
votes
4answers
637 views

Simplest possible secure sandboxing (limited resources needed)

I'm working on a project that implements distributed simulations: arbitrary code is executed on multiple nodes and the results are later collected and aggregated. Each node is an instance of an ...
6
votes
0answers
703 views

receive signal before process is being killed by OOM killer / cgroups

In our cluster, we are restricting our processes resources, e.g. memory (memory.limit_in_bytes). I think, in the end, this is also handled via the OOM killer in the Linux kernel (looks like it by ...
7
votes
3answers
5k views

How to create user cgroups with systemd

I use unprivileged lxc containers in Arch Linux. Here are the basic system infos: [chb@conventiont ~]$ uname -a Linux conventiont 3.17.4-Chb #1 SMP PREEMPT Fri Nov 28 12:39:54 UTC 2014 x86_64 GNU/...
6
votes
1answer
302 views

Executing a “fork bomb” safely

We've all seen the "fork bomb" that will render a host non-responsive, even if executed in an unprivileged shell: Warning: Do not execute the following shell script. Just don't. :(){ :|:& };: ...
6
votes
1answer
336 views

Can you throttle the bandwidth to a tmpfs based ramdisk?

I created a ramdisk using tmpfs as follows: sudo mount -t tmpfs -o size=1024m tmpfs /myramdisk I was looking into cgroup blkio subsystem bandwidth limits "read_bps_device" and "write_bps_device" ...
2
votes
2answers
525 views

Need help finding the CPU id numbers to use with cpu sets

The man for cpuset doesn't seem to clearly list how to figure out which numbers map to which processing units. My current machine has two Intel Xeon E5645s, each of which has 6 cores and ...