このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
01_linux:21_centos7:07_cgroup [2021/07/18 12:39] – matsui | 01_linux:21_centos7:07_cgroup [2021/07/24 08:30] (現在) – matsui | ||
---|---|---|---|
行 31: | 行 31: | ||
+ | ==== cgconfig.confで複数ディスクへ設定する場合 ==== | ||
+ | groupを複数書いておく | ||
+ | |||
+ | [/ | ||
+ | | ||
+ | group DiskIO_Group | ||
+ | blkio { | ||
+ | blkio.throttle.read_iops_device = "8:0 100"; | ||
+ | blkio.throttle.write_iops_device = "8:0 100"; | ||
+ | } | ||
+ | } | ||
+ | group DiskIO_Group | ||
+ | blkio { | ||
+ | blkio.throttle.read_iops_device = "251:0 100"; | ||
+ | blkio.throttle.write_iops_device = "251:0 100"; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | こうするとちゃんと反映される | ||
+ | < | ||
+ | # cat / | ||
+ | 8:0 100 | ||
+ | 251:0 100 | ||
+ | </ | ||
===== 反映 ===== | ===== 反映 ===== | ||
反映にはcgconfigとcgredプロセスを再起動で反映されます。 | 反映にはcgconfigとcgredプロセスを再起動で反映されます。 | ||
行 42: | 行 66: | ||
< | < | ||
- | # dd if=/ | + | # dd if=/ |
+ | 100+0 records in | ||
+ | 100+0 records out | ||
+ | 51200 bytes (51 kB) copied, 0.925756 s, 55.3 kB/s | ||
+ | |||
+ | # dd if=/ | ||
1000+0 records in | 1000+0 records in | ||
1000+0 records out | 1000+0 records out | ||
- | 4096000 | + | 512000 |
</ | </ | ||
+ | |||
+ | |||
+ | ===== コマンドラインで実行の場合 ===== | ||
+ | |||
+ | ==== CGruleを先に設定しておく ==== | ||
+ | echo "root blkio DiskIO_Group" | ||
+ | systemctl restart cgred | ||
+ | |||
+ | ==== グループ作成 ==== | ||
+ | |||
+ | cgcreate -g blkio:/ | ||
+ | |||
+ | ==== 設定追加 ==== | ||
+ | |||
+ | cgset -r blkio.throttle.write_iops_device=" | ||
+ | |||
+ | ==== 設定確認 ==== | ||
+ | |||
+ | cgget blkio.throttle.write_iops_device DiskIO_Group | ||
+ | |||
+ | # cgget -r blkio.throttle.write_iops_device DiskIO_Group | ||
+ | DiskIO_Group: | ||
+ | blkio.throttle.write_iops_device: | ||
+ | | ||
+ | 下記でも確認できる | ||
+ | # cat / | ||
+ | 8:0 10 | ||
+ | |||
+ | ==== 設定削除 ==== | ||
+ | cgdelete blkio:/ | ||
+ | |||
{{tag> | {{tag> |