ユーザ用ツール

サイト用ツール


01_linux:21_centos7:07_cgroup

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
01_linux:21_centos7:07_cgroup [2021/07/18 12:40] matsui01_linux:21_centos7:07_cgroup [2021/07/24 08:30] (現在) matsui
行 31: 行 31:
  
  
 +==== cgconfig.confで複数ディスクへ設定する場合 ====
 +groupを複数書いておく
 +
 +  [/etc/cgconfig.conf]
 +  
 +  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";
 +      }
 +  }
 +
 +こうするとちゃんと反映される
 +<code>
 +# cat /sys/fs/cgroup/blkio/DiskIO_Group/blkio.throttle.write_iops_device 
 +8:0 100
 +251:0 100
 +</code>
 ===== 反映 ===== ===== 反映 =====
 反映にはcgconfigとcgredプロセスを再起動で反映されます。 反映にはcgconfigとcgredプロセスを再起動で反映されます。
行 52: 行 76:
 512000 bytes (512 kB) copied, 9.92528 s, 51.6 kB/s 512000 bytes (512 kB) copied, 9.92528 s, 51.6 kB/s
 </code> </code>
 +
 +
 +===== コマンドラインで実行の場合 =====
 +
 +==== CGruleを先に設定しておく ====
 +  echo "root blkio DiskIO_Group" >>  /etc/cgrules.conf
 +  systemctl restart cgred
 +
 +==== グループ作成 ====
 +
 +  cgcreate -g blkio:/DiskIO_Group
 +
 +==== 設定追加 ====
 +
 +  cgset -r blkio.throttle.write_iops_device="8:0 10" DiskIO_Group
 +
 +==== 設定確認 ====
 +
 +  cgget blkio.throttle.write_iops_device DiskIO_Group
 +
 +  # cgget -r blkio.throttle.write_iops_device DiskIO_Group
 +  DiskIO_Group:
 +  blkio.throttle.write_iops_device: 8:0 10
 +  
 +下記でも確認できる
 +  # cat /sys/fs/cgroup/blkio/DiskIO_Group/blkio.throttle.write_iops_device
 +  8:0 10
 +
 +==== 設定削除 ====
 +  cgdelete blkio:/DiskIO_Group
 +
  
 {{tag>centos}} {{tag>centos}}
01_linux/21_centos7/07_cgroup.1626612054.txt.gz · 最終更新: 2021/07/18 12:40 by matsui