Set a disk quota
A disk quota limits how much space a hosting’s system user may use. Hyperion sets it as a Linux kernel quota, and an agent check every 5 minutes can also alert you or suspend the site when the hard cap is reached. A profile can set the same values for many sites.
Before you start
Section titled “Before you start”- You need manage access to the site and the Edit hosting config capability. To turn kernel quotas on for the node you must be an Administrator or Owner.
- Know that quotas count everything the site’s system user owns on that filesystem, not only the document root.
- Set the site’s Owner email on the same Settings & limits tab if the site owner should receive the over-quota email.
- Open Hostings, click the site, then the Settings & limits tab.
- Scroll to the Disk quota card. The badge shows
kernel-enforcedornot enforced, and the line under the title shows current usage in MiB. - Enter the Soft cap and Hard cap in MiB.
0means unlimited. The hard cap must be at least the soft cap. - Under When the hard cap is exceeded, choose Notify only (send an alert) or Suspend the site (+ alert).
- Click Save & apply quota.
The page then shows one of these messages.
- “Quota saved + applied to the kernel.” The cap is live.
- “Quota saved — kernel quotas need a reboot to finish activating — …”. The cap is stored and applied after the node reboots.
- “Quota saved, but NOT enforced — the kernel rejected it: …”. The cap is stored, the kernel refused it, and the card shows the reason.
What saving does to the node
Section titled “What saving does to the node”To do the same without saving a cap, click Enable kernel quotas automatically on the card. It appears only while quotas are off, and only for Administrators and Owners. Or enable it manually shows the commands to run yourself.
What happens at the cap
Section titled “What happens at the cap”With kernel quotas on, the kernel blocks writes when the site reaches the hard cap. The agent also checks all capped sites every 5 minutes, using the kernel’s own usage figure for the site’s user, and acts on the hard cap only.
- Notify only (send an alert): one alert when usage crosses the hard cap. It goes to the default Slack channel, to a panel notification for Owners and Administrators, and by email to the site’s Owner email. No second alert comes until usage drops below 90% of the cap and crosses it again.
- Suspend the site (+ alert): the site is suspended with the reason over-disk, and the same alerts go out. When usage falls below 90% of the hard cap, the site resumes on its own and the owner is told. If you resume the site by hand while it is still over, Hyperion does not suspend it again until usage has dropped under 90%. A site you suspended by hand, or one that expired, is never resumed by the quota check.
The soft cap is passed to the kernel as its soft limit. Hyperion’s alert and suspend actions use the hard cap only.
If the node’s quota subsystem cannot be read, the check skips the site. When quotas are off the card says so: writes are not blocked, and the over-quota action is the only enforcement. Usage then comes from du and covers the document root only.
Check that it worked
Section titled “Check that it worked”-
The badge on Disk quota reads
kernel-enforcedand the line under the title showslast appliedwith a time. -
On the node, report the quota for the site’s system user:
Terminal window sudo quota -u -w <system-user>The block limits match your caps in KiB, which is the MiB value times 1024.
sudo hctl hosting get <domain>prints the site’s system user. -
When the site is capped by a profile, the card shows
from <profile>.
If it fails
Section titled “If it fails”- “validation failed: disk hard limit must be >= soft limit”: raise the hard cap or lower the soft cap.
- “Quota saved, but NOT enforced — the kernel rejected it: setquota exit …”: read the rest of the line. A missing
quotapackage, a filesystem without quota support, or a failed remount are the usual causes. Use Or enable it manually and fix the filesystem. - A red box says the kernel rejected the last apply: the saved caps are not enforced. Correct the cause and save again.
- “couldn’t enable kernel quotas automatically: …”: the automatic enable failed. Follow the manual commands on the card.
- The card says a reboot is needed: reboot the node. The stored caps are applied automatically when it comes back.
- The over-quota e-mail does not arrive: set Owner email on the same tab. Without it only Slack and the panel notification fire.