Error detection Module Limit server resources (cgroups) error Invalid argument

Started by vanthoi, June 30, 2020, 04:45:40 PM

Previous topic - Next topic

vanthoi

I am performing tests with Cgroups.
I found out that this module has taken the wrong disk parameters. Specifically the MAJ: MIN part of the drive
Config on CWP:
blkio {
             blkio.throttle.read_bps_device = "8:33 20971520";
             blkio.throttle.write_bps_device = "8:33 20971520";
         }

In the case of lscgroup error:

Error: failed to set /sys/fs/cgroup/blkio/vanthoi/blkio.throttle.read_bps_device: Invalid argument
Error: failed to set /sys/fs/cgroup/blkio/vanthoi/blkio.throttle.write_bps_device: Invalid argument


After searching on google, I found an error caused by MAJ: MIN.
For example, my / home partition is / dev / sdc1 with MAJ: MIN 8:33

cat / proc / partitions | grep sdc
   8 32 262144000 sdc
   8 33 262142976 sdc1


But to limit the read / write speed on the hard disk, you need to use MAJ: MIN of the non-partition drive.

Config manal:

blkio {
             blkio.throttle.read_bps_device = "8:32 20971520";
             blkio.throttle.write_bps_device = "8:32 20971520";
         }


I then proceeded to correct MAJ: MIN in the configuration so that everything was resolved.

Send developers to fix this module in the next update.
I am running on CentOS Linux release 7.8.2003
Kernel Version: 3.10.0-1127.13.1.el7.x86_64



jmshosting

I have found the problem.

Cgroup/Kernel.org have chage the way to add blkio.throttle.read_bps_device and blkio.throttle.write_bps_device.

Before you add this way

Exampel for /dev/sda2
blkio.throttle.read_bps_device = "8:2 800000";
blkio.throttle.write_bps_device = "8:2 1024000";

The new is this
You add throttle for /dev/sda (the device) and not to the partitions /dev/sda2
blkio.throttle.read_bps_device = "8:0 800000";
blkio.throttle.write_bps_device = "8:0 1024000";

Readme here: https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt

Quick fix is to do the following

sed -i 's/8:2/8:0/g' /etc/cgconfig.d/* && systemctl restart cgconfig.service

This you need to do every time you change CGroup.

vanthoi

Quote from: Sandeep on July 01, 2020, 09:12:45 AM
hi try to remove cgroup then install it again.

Sorry for the late reply.
Recently, I was taking care of my wife, who gave birth to a baby, so I could not answer immediately.

I have done a clean uninstall of Cgroup then reinstalled.
But everything still hasn't changed, the drive limitation still fails.
The installation log does not detect any other errors.
You can set up testing on an esxi virtual machine to test.