Cgroups allow you to limit resources per user — such as CPU %, system memory, network bandwidth, or combinations of these resources.
Navigate to:
Security --> Cgroups Resource Limits
Dedicated Servers Limits Available
– CPU, Memory, Disk
VPS: KVM LimitsAvailable
– CPU, Memory, Disk
VPS: OpenVZLimitsAvailable
– Memory
Please note that some Cloud / VPS providers have a custom network that does not work with groups or limits that are not supported.
Requirements
– Default CentOS 7 kernel 3.10, possible to work with some others
– CloudLinuxis NOT supported
CPU Limit
The 100% limit is a fully used CPU core, all user processes share this limit.
For example, two user processes will have a CPU power of 50% each.
Limit range: 1 ~ (Number of cores) x 100, example for 4 cores: 1 ~ 400.
Result: The user’s websites may be slower to respond if the user has higher demand scripts.
RMEM (real RAM memory)
RAM limit in MB, the value of 1024 MB will limit the shared RAM for the user to 1 GB.
VMEM (Virtual Memory = RAM + swap)
Exchange limit in MB, the value of 2048 MB will limit the exchange for the user to 2 GB.
It is recommended to have swap (VMEM) higher than RAM (RMEM).
Result: when the limitis reaches the system it kills the most memory demanding process.
In case the script web server is down, it might return the server error 5xx in the active process.
Disk Limit (read / write)
Set the limit in KB per second, you can monitor this limit with iotop.
Result: The user’s websites may be slower to respond if the user has higher demand scripts.
Helpful Commands
cgdeletecpu: USERNAME (deletecpulimitfor USERNAME)
cgdeletememory: USERNAME (deletememorylimitfor USERNAME)
cgdeleteblkio: USERNAME (remove disk I / O limit for USERNAME)
You can choose the domain settings of the limits and policies you want to add.
Add New Policy: Add Name, cpu% (min 1 max 200), Memory (min 1M max 32G), Disk KB / s (min 100) and click Save.