ユーザ用ツール

サイト用ツール


サイドバー

このページの翻訳:



最近の更新



Tag Cloud

01_linux:21_centos7:07_cgroup

文書の過去の版を表示しています。


07 CentOS cgroupでリソースコントロール

cgroupsのインストール

yum install libcgroup libcgroup-tools

cgroupsの起動設定

/usr/bin/systemctl enable cgconfig
/usr/bin/systemctl enable cgred

QOS

※ディスクIDは、lsblkで確認
下記は/dev/sda(8:0)を100IOPS でlimitをかける場合

[/etc/cgconfig.conf]

group DiskIO_Group  {
    blkio {
        blkio.throttle.read_iops_device = "8:0 100";
        blkio.throttle.write_iops_device = "8:0 100";
    }
}
[/etc/cgrules.conf]
root	blkio	DiskIO_Group

反映

反映にはcgconfigとcgredプロセスを再起動で反映されます。

systemctl restart cgconfig && systemctl restart cgred

確認

4k block , count=1000が10秒ほどかかる。
1000 / 100IOPS = 10s

# dd if=/dev/zero of=AAA bs=512 count=100 oflag=direct
100+0 records in
100+0 records out
51200 bytes (51 kB) copied, 0.925756 s, 55.3 kB/s

# dd if=/dev/zero of=AAA bs=512 count=1000 oflag=direct
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 9.92528 s, 51.6 kB/s
01_linux/21_centos7/07_cgroup.1626612054.txt.gz · 最終更新: 2021/07/18 21:40 by matsui