Cgroups-cpu
Version vom 14. Oktober 2017, 15:17 Uhr von Thomas (Diskussion | Beiträge) (→Welche Parameter sind Subsystem Block-I/O vorhanden)
Anlegen von Control Groups
- cgcreate -g cpu:/cpulimited
- cgcreate -g cpu:/lesscpulimited
Welche Parameter sind vorhanden
- cgget -g cpu /cpulimited
/cpulimited: cpu.shares: 1024 cpu.cfs_quota_us: -1 cpu.stat: nr_periods 0 nr_throttled 0 throttled_time 0 cpu.cfs_period_us: 100000
Geschwindigkeit einschränken
- echo "8:16 1048576" > /sys/fs/cgroup/blkio/mygroup/blkio.throttle.write_bps_device
Ohne Einschränkung
- dd if=/dev/zero of=/tmp/test count=50 bs=100M
50+0 records in 50+0 records out 5242880000 bytes (5.2 GB, 4.9 GiB) copied, 23.0043 s, 228 MB/s
Mit Einschränkung(Funktioniert nicht wie gewünscht)
- cgexec -g blkio:/mygroup dd if=/dev/zero of=/tmp/test count=50 bs=100M