HF PanelDocsv1.0.0

Resource limits

Limit each account's CPU, memory, disk speed, processes and PHP workers, give one account its own limits, and see the busiest accounts.

Resource limits keep one busy account from slowing down everyone else. Each package sets how much CPU, memory, disk speed and how many processes an account may use; you can give a single account other limits, and Top accounts shows who uses the most.

Where: Server Admin › Accounts › Packages (the limits), Server Admin › Accounts › Top accounts (usage and one account's limits)

What can be limited

Limit What it holds back
CPU (cores, 0 = unlimited) CPU time: 1 = one full core, 0.5 = half a core, 2 = two cores
Memory (MB, 0 = unlimited) memory: the account is slowed down at 90% of the limit and processes are stopped at 100%
Processes (0 = unlimited) processes and threads at once
Disk speed (MB/s, 0 = unlimited) how fast the account reads and writes the disk /home is on, each way
Disk operations (IOPS, 0 = unlimited) disk reads and writes per second
PHP workers (0 = unlimited) PHP processes each website pool runs at once
App processes (0 = unlimited) processes each Node.js, Python or Ruby app may run

Set them per package under Packages. 0 always means unlimited.

How they are enforced

Each hosting account gets its own systemd slice, hf-<username>.slice, with the limits as cgroup v2 settings (CPUQuota, MemoryHigh and MemoryMax, TasksMax, and IOReadBandwidthMax / IOWriteBandwidthMax / IOReadIOPSMax / IOWriteIOPSMax for the disk /home is on). Everything the account runs shares the limits:

  • its websites: each account's PHP-FPM runs in its own service inside the slice;
  • its Node.js, Python and Ruby apps and Docker apps;
  • its cron jobs and SSH and SFTP sessions (the account's login slice gets the same limits).

The limits are applied when an account is created, moves to another package, is suspended or unsuspended, and after a full restore from a backup; a changed package goes to all its accounts at once. The slice files stay on the server, so the limits are back as soon as it boots. Applying the same limits again changes nothing.

The PHP worker limit works as soon as you set it. The other limits hold back websites and apps only once you click Enforce limits under Packages: until then all accounts share the PHP services, and only cron jobs and SSH and SFTP sessions are held back.

Important: limits need cgroup v2, which Ubuntu 22.04, Ubuntu 24.04 and Debian 12 use. On a server that still uses cgroup v1, Packages and Top accounts say Resource limits are not supported on this server: it uses cgroup v1: the limits are saved but not enforced, and nothing is measured.

Give one account its own limits

  1. Open Top accounts and click Charts on the account's row (or, under Accounts, open Manage › Resource usage and limits).
  2. Under Limits of this account, fill in the limits that should differ from the package. Each field shows the package's value; leave a field empty to keep it, enter 0 for unlimited.
  3. Click Save. The limits apply at once.

To go back to the package's limits, empty the fields and click Save.

Note: only administrators change an account's own limits. Resellers see their customers' usage and limits.

Top accounts

Top accounts lists the accounts with their use over the period you pick (24 hours, 7 days, 30 days, 1 year), sorted by CPU, Memory, Disk I/O or Limit hits:

Column What it shows
CPU (average / peak) CPU use in % (100% = one core), and the package's limit; red from 90% of it
Memory (average / peak) memory in MB, and the limit
Disk I/O disk MB/s and operations per second on average
Processes the most processes at once
Minutes at a limit how many minutes the account was at any limit

Charts opens that account's charts — CPU, memory, disk I/O, processes, disk space and bandwidth, each with Show as table — its limit hits and its limits. Resellers see only their own customers.

How usage is measured

Every minute the panel reads each account's cgroup counters (CPU time, memory, processes, disk reads and writes, and how often a limit acted) with one call per server, from the cron job hf-api usage. It keeps a point a minute for 24 hours, an hour for 30 days and a day for a year, and removes older points by itself.

When an account is at its limit

The first minute at a limit adds a line to the account's Limit hits. When an account has been at a CPU, memory, process or disk limit for 15 minutes, or a process was stopped because the account ran out of memory:

  • the customer gets a notice and an email (their notification settings decide how);
  • you and the account's reseller get Customer account at its limit in your notifications, with a link to the account's charts;
  • the hook event account.limit_reached is raised for webhooks and script hooks.

Each happens at most once a day for each kind of limit. The customer's Resource usage screen shows a notice too, with Upgrade plan when billing is on.