This module in CWP allows you to Limit Server Resources per User using cgroups.

Video instructions

Example of cgroups in action on CWP servers

Dedicated Servers Limits Available
- CPU, Memory, Disk

VPS: KVM Limits Available
- CPU, Memory, Disk

VPS: OpenVZ Limits Available
- Memory

Please note that some Cloud/VPS providers have a custom kernel that doesn't work with cgroups or some limits are no supported.

Requirements
- Default CentOS 7 kernel 3.10, possible to work with some others
- CloudLinux is NOT supported


CPU Limit
Limit 100% is one CPU core fully used, all user processes are sharing 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: User websites might have a slower response if the user has higher demanding scripts.

RMEM (Real Memory RAM)
RAM limit in MB, the value of 1024 MB will limit shared RAM for the user to 1GB.

VMEM (Virtual Memory = RAM + swap)
Swap limit in MB, the value of 2048 MB will limit swap for the user to 2GB.
It's recommended to have swap (VMEM) higher than RAM (RMEM).

Result: When the ram limit is reached system will kill the most memory demanding process.
In case of killed script webserver could return server error 5xx on the active process.

Disk Limit (read / write)
Set the limit in KB per second, you can monitor this limit with iotop.

Result: User websites might have a slower response if the user has higher demanding scripts.

Useful commands
cgdelete cpu:USERNAME (delete cpu limit for USERNAME)
cgdelete memory:USERNAME (delete memory limit for USERNAME)
cgdelete blkio:USERNAME (delete disk IO limit for USERNAME)


Check Also: Process, Inode and Open files Limits per User

Tagged: