Cgroups-cpu
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
- cgget -g cpu /lesscpulimited
/lesscpulimited: cpu.shares: 1024 cpu.cfs_quota_us: -1 cpu.stat: nr_periods 0 nr_throttled 0 throttled_time 0 cpu.cfs_period_us: 100000
Normaler Wert ist 1024
- cgset -r cpu.shares=512 cpulimited
Testpogramm
- apt install mathomatic-primes
Mit Einschränkung(Funktioniert nicht wie gewünscht)
- cgexec -g blkio:/mygroup dd if=/dev/zero of=/tmp/test count=50 bs=100M