Limit RAM and CPUs for Chromium (browsers) with cgroups
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
sometimes my Chromium eats a lot of RAM and CPUs. I would like to limit its processes. I read how to do it with cgroup managing in Arch and RedHat wiki pages and some other sites. According that I configured my:
$ cat /etc/cgconfig.conf
mount
cpu = /sys/fs/cgroup/browsers;
cpuacct = /sys/fs/cgroup/browsers;
memory = /sys/fs/cgroup/browsers;
group browsers
# perm
# # Who can manage limits
# admin
# uid = root;
# gid = users;
#
# # Who can add tasks to this group
# task
# uid = waldauf;
# gid = users;
#
#
cpu
# # Set the relative share of CPU resources equal to 25%
cpu.shares = "256";
# # Use max 4 CPUs at time
# cpuset
# cpuset.cpus="0-4"
#
cpuacct
cpuacct.usage="0";
memory
# # Allocate at most 1 GB of memory to tasks
memory.limit_in_bytes = "8G";
# # Apply a soft limit of 512 MB to tasks
memory.soft_limit_in_bytes = "6G";
and
$ cat /etc/cgrules.conf
### LIMIT FOR CHROMIUM
# user:process subsystems group
waldauf:/usr/lib/chromium/chromium cpu,memory browsers
When I checked configuration I got this error message:
$ sudo cgconfigparser -l /etc/cgconfig.conf
Error: cannot create directory /sys/fs/cgroup/browsers
cgconfigparser; error loading /etc/cgconfig.conf: Cgroup, operation not allowed
After that I commented mount
then parser run alright. I restarted cgconfig.service in systemd. But in /sys/fs/cgroup/
is not created new browsers cgroup.
$ sudo systemctl restart cgconfig.service
$ ll /sys/fs/cgroup
total 0
dr-xr-xr-x 2 root root 0 Oct 27 18:55 blkio/
lrwxrwxrwx 1 root root 11 Oct 27 18:55 cpu -> cpu,cpuacct/
dr-xr-xr-x 3 root root 0 Oct 27 18:55 cpu,cpuacct/
lrwxrwxrwx 1 root root 11 Oct 27 18:55 cpuacct -> cpu,cpuacct/
~
What next I tried:
Create cgroup direcotry in system's /tmp directory. But I got:
sudo cgconfigparser -l /etc/cgconfig.conf
Error: cannot mount cpu to /tmp/cgroup/browsers: Device or resource busy
cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failedThe same error I got createing new tmpfs mount
/tmp/cgroup
.
Can I ask you for the kick which moves me in the right way? :]
linux cgroups
add a comment |Â
up vote
0
down vote
favorite
sometimes my Chromium eats a lot of RAM and CPUs. I would like to limit its processes. I read how to do it with cgroup managing in Arch and RedHat wiki pages and some other sites. According that I configured my:
$ cat /etc/cgconfig.conf
mount
cpu = /sys/fs/cgroup/browsers;
cpuacct = /sys/fs/cgroup/browsers;
memory = /sys/fs/cgroup/browsers;
group browsers
# perm
# # Who can manage limits
# admin
# uid = root;
# gid = users;
#
# # Who can add tasks to this group
# task
# uid = waldauf;
# gid = users;
#
#
cpu
# # Set the relative share of CPU resources equal to 25%
cpu.shares = "256";
# # Use max 4 CPUs at time
# cpuset
# cpuset.cpus="0-4"
#
cpuacct
cpuacct.usage="0";
memory
# # Allocate at most 1 GB of memory to tasks
memory.limit_in_bytes = "8G";
# # Apply a soft limit of 512 MB to tasks
memory.soft_limit_in_bytes = "6G";
and
$ cat /etc/cgrules.conf
### LIMIT FOR CHROMIUM
# user:process subsystems group
waldauf:/usr/lib/chromium/chromium cpu,memory browsers
When I checked configuration I got this error message:
$ sudo cgconfigparser -l /etc/cgconfig.conf
Error: cannot create directory /sys/fs/cgroup/browsers
cgconfigparser; error loading /etc/cgconfig.conf: Cgroup, operation not allowed
After that I commented mount
then parser run alright. I restarted cgconfig.service in systemd. But in /sys/fs/cgroup/
is not created new browsers cgroup.
$ sudo systemctl restart cgconfig.service
$ ll /sys/fs/cgroup
total 0
dr-xr-xr-x 2 root root 0 Oct 27 18:55 blkio/
lrwxrwxrwx 1 root root 11 Oct 27 18:55 cpu -> cpu,cpuacct/
dr-xr-xr-x 3 root root 0 Oct 27 18:55 cpu,cpuacct/
lrwxrwxrwx 1 root root 11 Oct 27 18:55 cpuacct -> cpu,cpuacct/
~
What next I tried:
Create cgroup direcotry in system's /tmp directory. But I got:
sudo cgconfigparser -l /etc/cgconfig.conf
Error: cannot mount cpu to /tmp/cgroup/browsers: Device or resource busy
cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failedThe same error I got createing new tmpfs mount
/tmp/cgroup
.
Can I ask you for the kick which moves me in the right way? :]
linux cgroups
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
sometimes my Chromium eats a lot of RAM and CPUs. I would like to limit its processes. I read how to do it with cgroup managing in Arch and RedHat wiki pages and some other sites. According that I configured my:
$ cat /etc/cgconfig.conf
mount
cpu = /sys/fs/cgroup/browsers;
cpuacct = /sys/fs/cgroup/browsers;
memory = /sys/fs/cgroup/browsers;
group browsers
# perm
# # Who can manage limits
# admin
# uid = root;
# gid = users;
#
# # Who can add tasks to this group
# task
# uid = waldauf;
# gid = users;
#
#
cpu
# # Set the relative share of CPU resources equal to 25%
cpu.shares = "256";
# # Use max 4 CPUs at time
# cpuset
# cpuset.cpus="0-4"
#
cpuacct
cpuacct.usage="0";
memory
# # Allocate at most 1 GB of memory to tasks
memory.limit_in_bytes = "8G";
# # Apply a soft limit of 512 MB to tasks
memory.soft_limit_in_bytes = "6G";
and
$ cat /etc/cgrules.conf
### LIMIT FOR CHROMIUM
# user:process subsystems group
waldauf:/usr/lib/chromium/chromium cpu,memory browsers
When I checked configuration I got this error message:
$ sudo cgconfigparser -l /etc/cgconfig.conf
Error: cannot create directory /sys/fs/cgroup/browsers
cgconfigparser; error loading /etc/cgconfig.conf: Cgroup, operation not allowed
After that I commented mount
then parser run alright. I restarted cgconfig.service in systemd. But in /sys/fs/cgroup/
is not created new browsers cgroup.
$ sudo systemctl restart cgconfig.service
$ ll /sys/fs/cgroup
total 0
dr-xr-xr-x 2 root root 0 Oct 27 18:55 blkio/
lrwxrwxrwx 1 root root 11 Oct 27 18:55 cpu -> cpu,cpuacct/
dr-xr-xr-x 3 root root 0 Oct 27 18:55 cpu,cpuacct/
lrwxrwxrwx 1 root root 11 Oct 27 18:55 cpuacct -> cpu,cpuacct/
~
What next I tried:
Create cgroup direcotry in system's /tmp directory. But I got:
sudo cgconfigparser -l /etc/cgconfig.conf
Error: cannot mount cpu to /tmp/cgroup/browsers: Device or resource busy
cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failedThe same error I got createing new tmpfs mount
/tmp/cgroup
.
Can I ask you for the kick which moves me in the right way? :]
linux cgroups
sometimes my Chromium eats a lot of RAM and CPUs. I would like to limit its processes. I read how to do it with cgroup managing in Arch and RedHat wiki pages and some other sites. According that I configured my:
$ cat /etc/cgconfig.conf
mount
cpu = /sys/fs/cgroup/browsers;
cpuacct = /sys/fs/cgroup/browsers;
memory = /sys/fs/cgroup/browsers;
group browsers
# perm
# # Who can manage limits
# admin
# uid = root;
# gid = users;
#
# # Who can add tasks to this group
# task
# uid = waldauf;
# gid = users;
#
#
cpu
# # Set the relative share of CPU resources equal to 25%
cpu.shares = "256";
# # Use max 4 CPUs at time
# cpuset
# cpuset.cpus="0-4"
#
cpuacct
cpuacct.usage="0";
memory
# # Allocate at most 1 GB of memory to tasks
memory.limit_in_bytes = "8G";
# # Apply a soft limit of 512 MB to tasks
memory.soft_limit_in_bytes = "6G";
and
$ cat /etc/cgrules.conf
### LIMIT FOR CHROMIUM
# user:process subsystems group
waldauf:/usr/lib/chromium/chromium cpu,memory browsers
When I checked configuration I got this error message:
$ sudo cgconfigparser -l /etc/cgconfig.conf
Error: cannot create directory /sys/fs/cgroup/browsers
cgconfigparser; error loading /etc/cgconfig.conf: Cgroup, operation not allowed
After that I commented mount
then parser run alright. I restarted cgconfig.service in systemd. But in /sys/fs/cgroup/
is not created new browsers cgroup.
$ sudo systemctl restart cgconfig.service
$ ll /sys/fs/cgroup
total 0
dr-xr-xr-x 2 root root 0 Oct 27 18:55 blkio/
lrwxrwxrwx 1 root root 11 Oct 27 18:55 cpu -> cpu,cpuacct/
dr-xr-xr-x 3 root root 0 Oct 27 18:55 cpu,cpuacct/
lrwxrwxrwx 1 root root 11 Oct 27 18:55 cpuacct -> cpu,cpuacct/
~
What next I tried:
Create cgroup direcotry in system's /tmp directory. But I got:
sudo cgconfigparser -l /etc/cgconfig.conf
Error: cannot mount cpu to /tmp/cgroup/browsers: Device or resource busy
cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failedThe same error I got createing new tmpfs mount
/tmp/cgroup
.
Can I ask you for the kick which moves me in the right way? :]
linux cgroups
linux cgroups
asked 16 mins ago
waldauf
6016
6016
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478143%2flimit-ram-and-cpus-for-chromium-browsers-with-cgroups%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password