Difference between revisions of "Cgcreate"
Jump to navigation
Jump to search
Line 8: | Line 8: | ||
[[CPU]] | [[CPU]] | ||
− | cgcreate -g cpu:/ | + | cgcreate -g cpu:/myCpulimit |
− | [[cgset]] -r cpu.cfs_period_us=1000000 | + | [[cgset]] -r cpu.cfs_period_us=1000000 myCpulimit |
− | [[cgset]] -r cpu.cfs_quota_us=100000 | + | [[cgset]] -r cpu.cfs_quota_us=100000 myCpulimit |
+ | cgget -g cpu:myCpulimit | ||
+ | |||
Revision as of 06:30, 22 May 2020
cgcreate
command is included in the cgroup-tools
packages https://linux.die.net/man/1/cgcreate
cgcreate -g memory:myGroup echo 500M > /sys/fs/cgroup/memory/myGroup/memory.limit_in_bytes echo 5G > /sys/fs/cgroup/memory/myGroup/memory.memsw.limit_in_bytes cgexec -g memory:myGroup PROGRAM_TO_EXECUTE
cgcreate -g cpu:/myCpulimit cgset -r cpu.cfs_period_us=1000000 myCpulimit cgset -r cpu.cfs_quota_us=100000 myCpulimit cgget -g cpu:myCpulimit
Controller | Can be controlled by user | Options |
---|---|---|
cpu | Yes (Requires delegation) | CPUAccounting, CPUWeight, CPUQuota, AllowedCPUs, AllowedMemoryNodes |
io | Yes (Requires delegation) | IOWeight, IOReadBandwidthMax, IOWriteBandwidthMax, IODeviceLatencyTargetSec |
memory | Yes | MemoryLow, MemoryHigh, MemoryMax, MemorySwapMax |
pids | Yes | TasksMax |
rdma | No | ? |
eBPF | No | IPAddressDeny, DeviceAllow, DevicePolicy |
Related commands
See also
Advertising: