Open sourceIn the free reqad package (GPL-3.0).

Resource usage

Reqad checks what every hosting account uses of the server's processors and memory once a minute: each site's PHP, mail, SSH / cron / terminal sessions and background jobs, and its database connections, against its limits. You see every account in Accounts & Domains > Resource Usage; with the account panel, each account sees its own under Metrics > Resource usage, with what it runs now and a Stop button.

What is counted

PartCounted from
SSH, cron and terminalThe account's sessions all run in its own group of processes (the user-<uid>.slice), which has exact counters for CPU, memory and processes, also for processes that ended between two checks. These are the numbers its session limits are kept to.
Each site's PHPThe site's PHP-FPM workers (php-fpm: pool <domain>), which run as the account. Their number is the site's PHP workers; pm.max_children of the pool is its limit.
EmailIMAP and POP3 logins (mail apps, webmail), which run as the account.
Background jobsEverything else that runs as the account: WordPress updates, deployments, Node.js / Python apps.
Database connectionsOpen connections per database user, against the account's connection limit.

CPU: 100% is one core, as in top. Memory: the proportional set size of each process, so a page several processes share counts once and the total is what the account really holds. Not counted per account: database queries (they run in MariaDB), the web and mail servers themselves, and sites on PHP inside Apache (mod_php), which run as the web server. A process that starts and ends between two checks is missed, except in the sessions' group. Rest of the server is the server's CPU that is not any account's.

Limits reached

KindFound in
All PHP workers busyPHP-FPM's error log: server reached max_children setting for the site's pool. Visitors wait for a free worker; a long wait ends in 502 or 504.
Request stoppedPHP-FPM's error log: execution timed out, with the script and the address asked for (without its query string).
Database connections fullA database user at its connection limit at a check.
Stopped by the memory limitThe kernel's note when the session memory limit stopped a process (the session limits' log).
New process refusedThe kernel's note when the session process limit refused a new process.
Held at the CPU limitThe sessions' group was slowed down at its CPU limit, in minutes. Nothing is stopped at this limit.

The same limit reached again within 15 minutes adds to the last one. A site that runs out of PHP workers 3 or more separate times in 24 hours, and a process stopped by the memory limit, also show in Needs attention, for you and for the account, which can be told by mail.

How it is collected

  • Cron runs reqad resources collect every minute. It reads /proc once for every account (a few hundredths of a second), the sessions' counters and the new lines of the logs above.
  • The numbers are kept in their own file, /var/lib/reqad/stats/usage.db: points of 5 minutes for 8 days and of an hour for 90 days (the 30 days view adds 4 hours together), and the limits reached for 90 days. Each point keeps the average of its checks and the highest one.
  • If the checks stop for 15 minutes, Needs attention says so.

Resource Usage

Accounts & Domains > Resource Usage shows the server's CPU and memory, the accounts' share and the rest of the server, then every account over the last 24 hours, 7 days or 30 days, busiest first: CPU and memory (average and highest check, with its time), processes, PHP workers at the most and the limits it reached, and its plan with Hosting Pro. Click a column heading (account, plan, CPU, memory, processes, PHP workers) to sort by it, highest first; click it again for the other way. Click an account to split it into its sessions, each site's PHP, email and background jobs. Details opens the account's own page in its account panel, where its processes can be stopped; Limits opens its session limits. The page only reads: nothing is stopped from it.

Command line, API and AI assistants

reqad resources usage     [--range=day|week|month]
reqad resources show      <account> [--range=day|week|month]
reqad resources processes <account>
reqad resources stop      <account> <pid> --start=TICKS
reqad resources collect

The REST API has GET /api/v1/resources (every account), GET /api/v1/resources/{account} (one account over ?range=; me with an account's token), GET /api/v1/resources/{account}/processes and POST /api/v1/resources/{account}/processes/{pid}/stop. AI assistants get the two reads as the tools resource_usage and account_resources; they cannot list or stop processes. More on the CLI page.


Need a hand? Create a free account or contact us.