Cgroups-memory
Version vom 14. Oktober 2017, 19:36 Uhr von Thomas (Diskussion | Beiträge) (→Anlegen von Control Groups)
Anlegen von Control Groups
- cgcreate -g memory:/foo
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
Testprogramm
- apt install mathomatic-primes
3 Limitierte Prozesse und einen Unlimitierten starten
- cgexec -g cpu:cpulimited matho-primes 0 9999999999 > /dev/null
- cgexec -g cpu:cpulimited matho-primes 0 9999999999 > /dev/null
- cgexec -g cpu:cpulimited matho-primes 0 9999999999 > /dev/null
- cgexec -g cpu:lesscpulimited matho-primes 0 9999999999 > /dev/null
Top
- top