Each isolated website on a CloudLinux server can now have its own CPU, memory, I/O and process limits. Give a site its own limits, and when it gets busy it’s throttled on its own, while the other sites in the same hosting account keep the resources they depend on. The account’s limit still caps the total, meaning that all of its sites together can’t use more than the account is allowed.
This is Phase 3 of CloudLinux Isolates. Phase 1 gave each site its own isolated filesystem, and Phase 2 its own PHP version, but the sites in an account still shared its resource limits. Now each site can have its own. Per-site limits are in beta for cPanel servers running CloudLinux 8 and 9, included in existing subscriptions at no extra cost.
What you get with per-site limits
Sites can use spare capacity. Site limits can add up to more than the account’s. Say an account’s CPU limit is 100% and its three sites are set to 50% each. While two of them are quiet, the busy one can use its full 50%. When all three are busy, they share the 100%. A site without limits of its own keeps using the account’s limits, the way every site did before this release.
You can see which site used what. Per-site usage shows up in lveinfo and lvechart, and account owners can check their own sites with isolatectl stats. When an isolated site hits one of its own limits, the account owner’s fault email now names the site and the limit it hit. There’s no separate email per site, and the email goes out on the same schedule as before.
As light as an account limit. A site’s limits add no more overhead on the server than an account’s do.
How it works
Each isolated site gets its own LVE (Lightweight Virtual Environment, the container CloudLinux uses to apply resource limits), placed under its account’s. The account’s usage is the total of its sites and its own processes. Account owners set a site’s limits with isolatectl.
Current limitations
- Per-site limits need cPanel and CloudLinux 8 or 9. On CloudLinux 7, isolated sites keep their file isolation but per-site resource limits are not available.
- Per-site limits don’t apply on LiteSpeed Web Server yet.
- Database limits stay per account. MySQL Governor, which caps each account’s database usage, doesn’t split it by site.
- Fault emails still go to the account’s contact address, not to individual site owners.
- Per-site limits are available on the Up to 5 Hosting Accounts (Admin) and Unlimited Hosting Accounts (Shared Pro) tiers. The Single Hosting Account (Solo) tier isn’t included yet.
Try it on a server
Install the updated packages from the testing repository first. The documentation lists the rest of the Isolates prerequisites.
yum update --enablerepo=cloudlinux-updates-testing lve-stats3 lve-utils lve liblve cagefs
| Package | Minimum version |
|---|---|
| lve-stats3 | 5.1.0-1 |
| lve-utils | 6.6.41-1 |
New to Isolates? Allow it for an account and isolate a site. With the updated packages installed, these two commands also turn on per-site limits for the site:
cagefsctl --site-isolation-allow <user> # or --site-isolation-allow-all for every account
cagefsctl --site-isolation-enable <domain>
Already using Isolates? Simply updating the packages doesn’t change the sites you’ve already isolated. They keep sharing their account’s limits until you move them. Turn per-site limits on for each account, then for each of its isolated sites (cagefsctl --site-isolation-list shows them):
lvectl allow-domain-limits <user>
lvectl enable-domain-limits <domain>
lvectl list-domains <uid> # check, using the account's numeric UID
To turn per-site limits off again, run lvectl disable-domain-limits <domain> for a site or lvectl deny-domain-limits <user> for a whole account.
Set a site’s limits from the account that owns it:
isolatectl limits set --domain example.com --cpu 5000 --pmem 268435456 --io 2048
isolatectl stats --domain example.com
The first command gives example.com 50% CPU, 256 MB of memory and 2 MB/s of disk I/O. The second shows the site’s usage, peaks and faults. The documentation covers the other limits, their units and the statistics tools.
Tell us how it works
Per-site limits are in beta, and we’d like to hear in the comments how they work on your servers. If you need any assistance, contact our support team.
Comments