How to monitor Postgres usage across the fleet
Where to see aggregate and per-instance usage — storage on disk, active connections, query rate — and how often the numbers refresh.
Last updated 20 days ago
How to monitor Postgres usage across the fleet
What ImpulseDB Postgres collects
Usage telemetry runs nightly at 02:00 via impulsepostgres_usage.php, the same cron that triggers backups. For every active instance it collects:
- Storage on disk (bytes used by the database directory).
- Active connection count (via
pg_stat_activity). - Per-database row counts and query rate, where collected.
Numbers refresh once per daily cron tick in most installs. If you need fresher snapshots you can trigger an ad-hoc usage sweep from the diagnostics page — but the customer-visible numbers and quota enforcement run on the nightly cadence.
Where to see fleet-wide aggregates
- Open the ImpulseDB Postgres admin tab. Addons > ImpulseDB Postgres.
- Overview tab. The dashboard at the top of Overview shows total instance count, total storage in use, and a usage breakdown by plan. The numbers reflect the most recent usage sweep.
- Servers tab. Each shared host row shows aggregate storage and connection counts for the tenants on it. Dedicated server rows show the single instance's stats. Rows with utilization above your configured warning threshold render an amber badge.
Where to see per-instance usage
- Customers tab. Filter or search to find the service. The list view shows last-snapshot storage and current quota for every instance.
- Click into the service. The detail page shows the current snapshot side-by-side with the plan quota — storage used / quota, connections active / pool size, plus a sparkline of recent snapshots if you've been collecting for at least a few days.
SQL spot-check
If you want a quick fleet-wide aggregate without opening the UI:
SELECT plan_slug, COUNT(*) AS instances, SUM(storage_bytes) / 1024 / 1024 / 1024 AS total_gb, SUM(active_connections) AS total_conns FROM mod_impulsepostgres_instances i JOIN mod_impulsepostgres_usage u ON u.service_id = i.service_id WHERE u.snapshot_at = (SELECT MAX(snapshot_at) FROM mod_impulsepostgres_usage WHERE service_id = i.service_id) GROUP BY plan_slug ORDER BY total_gb DESC; Table names may vary slightly across module versions — check SHOW TABLES LIKE 'mod_impulsepostgres_%' if these don't resolve.
If usage hasn't refreshed
Symptoms: all instances show the same stale snapshot timestamp on the Customers tab, or the Overview totals haven't moved in days.
- Check the ImpulseCore Cron Health page. Addons > ImpulseCore > Cron Health. Look for the ImpulseDB Postgres usage task. If it's red or stale, that's your culprit.
- Confirm the usage cron is installed on the WHMCS box. The shipped crontab line:
0 2 * * * /usr/bin/php /path/to/whmcs/crons/impulsepostgres_usage.php Replace /usr/bin/php with your PHP CLI binary. On Plesk: /opt/plesk/php/8.3/bin/php. On cPanel: /opt/cpanel/ea-php83/root/usr/bin/php. On a vanilla LAMP install: /usr/bin/php or whatever which php returns. Replace /path/to/whmcs with your install dir.
- Filter the audit log. Tools > Audit Log, filter to
module=impulsedb-postgresandevent LIKE '%usage%'. The most recent rows surface any per-host SSH or SQL errors during collection. - Run an ad-hoc usage sweep. Tools > Diagnostics has a manual trigger that calls the usage task synchronously. It surfaces errors in the browser rather than swallowing them into the cron log.
What customers see
The client-area service page has a Usage card showing the customer's most recent storage and connection numbers against their plan quota. Updates land within a few hours of the nightly sweep. Customers don't see fleet-wide aggregates — those are operator-only.