If you manage multiple hosting accounts on a single server, a single abusive user can easily consume all your CPU, RAM, or disk I/O — slowing down or even crashing other websites. Thankfully, Control Web Panel (CWP) includes built-in support for Cgroups, a powerful Linux kernel feature that lets you limit and control resource usage per user.
In this guide, you’ll learn how to enable, configure, and apply Cgroups in CWP to keep your server stable and your hosting environment fair.
🧠 What Are Cgroups?
Cgroups (Control Groups) are a Linux feature that allows system administrators to:
- Limit CPU and RAM usage
- Control disk I/O speed
- Isolate heavy processes
- Monitor resource consumption per user or group
CWP Pro integrates this into the panel so you can apply limits per hosting account with just a few clicks.
✅ Benefits of Using Cgroups in CWP
- Prevent a single user from hogging CPU or RAM
- Guarantee fair usage for all accounts
- Keep high-traffic or buggy sites from affecting others
- Enforce resource plans like shared hosting tiers
🔧 Step-by-Step: Enabling & Using Cgroups in CWP
🔹 Step 1: Enable Cgroups in CWP
- Log into CWP Admin
- Go to:
System → Cgroups - Click Enable Cgroups
If you get an error like “Cgroups not supported”, check that your kernel supports it (v1 is required) and ensure
cgroup
modules are loaded.
🔹 Step 2: Create a Cgroup Resource Plan
Go to:
System → Cgroups → Add New Plan
Set the following:
- Plan Name: basic_2cpu_512mb
- CPU Limit: e.g.,
20
(for 20% of 1 core) - RAM Limit (MB):
512
- Disk I/O:
- Read (KB/s):
2048
(2 MB/s) - Write (KB/s):
1024
(1 MB/s)
- Read (KB/s):
You can also enter
51200
(50 MB/s) for high-performance plans.
Click Save Plan.
🔹 Step 3: Assign Plan to a User
- Go to:
User Accounts → List Accounts - In the Cgroups column, select your resource plan from the dropdown
- Click Apply
✅ That user is now isolated to the defined CPU, memory, and I/O limits.
📊 Recommended Limits Based on Hosting Tier
Tier | CPU (%) | RAM (MB) | Read KB/s | Write KB/s |
---|---|---|---|---|
Basic Shared | 10–20 | 256–512 | 2048 | 1024 |
Standard Plan | 25–40 | 1024 | 4096–8192 | 2048 |
High-Traffic | 50–80 | 2048–4096 | 51200 | 51200 |
Developer VPS | 100 | Unlimited | Unlimited | Unlimited |
You can modify these depending on your server hardware (HDD vs SSD/NVMe).
🧪 Monitor Resource Usage
In System → Cgroups, you can view:
- Current CPU % per user
- RAM usage
- Active I/O limits
You can also monitor system-wide behavior via:
top
htop
iotop
🔐 Pro Tips for Stable Hosting
- Pair Cgroups with CSF + LFD for abuse protection
- Use ModSecurity to prevent script-based overloads
- Combine with PHP-FPM pools per user for better isolation
🧠 Cgroups vs Other Tools
Tool | Purpose |
---|---|
Cgroups | Resource limiting per user |
CSF/LFD | Firewall, login failure daemon |
ModSecurity | Application-level protection |
PHP-FPM Pools | Per-user PHP resource tuning |
Together, they form a strong defense for stable, secure shared hosting.
💬 Need Help Configuring Cgroups?
If you’d prefer expert setup and optimization for your hosting plans:
📨 Contact Servers9 Support — we’ll configure Cgroups, PHP resource limits, and firewall rules for maximum performance and security.