Multi-server health

When the web tier and background workers run on separate servers, each machine should run only the health probes that apply to that role. Cinder can still show a single combined view by merging worker snapshots from shared Redis on the public health endpoint.

Overview

  1. Worker — runs php artisan cinder:health every minute (via Laravel's scheduler), including the Horizon, queue and scheduler probes. Its snapshot is stored in Redis under a node-specific cache key. The worker does not need the health HTTP endpoint enabled.
  2. Web — runs web-appropriate probes when Cinder polls /cinder/v1/health, then merges in the latest worker snapshot from Redis.

All servers must share the same Redis cache store (and prefix) so node snapshots are visible everywhere.

Environment variables

Web server

CINDER_HEALTH_ENDPOINT_ENABLED=true
CINDER_HEALTH_CHECK_SECRET=your-secret
CINDER_HEALTH_NODE=web
CINDER_HEALTH_NODE_LABEL=Web
CINDER_HEALTH_AGGREGATE_NODES=worker
CINDER_HEALTH_UPDATES_SCHEDULE_HEARTBEAT=false

Do not run php artisan schedule:run on the web server when the worker already runs the scheduler.

Worker server

CINDER_HEALTH_NODE=worker
CINDER_HEALTH_NODE_LABEL=Worker

Enable the Laravel scheduler on this server only. Keep cinder:health scheduled every minute.

Registering probes per node

Register different probes per CINDER_HEALTH_NODE in a service provider with Cinder::probes([...]) (read the node from config('cinder.health.node.name')). On web, skip the Horizon, queue and scheduler probes. On worker, include them.

See registering probes and available probes.

Response shape

When aggregation is enabled, the health endpoint returns:

  • probes — flattened list across all nodes, each with a node key (used for monitor status)
  • nodes — one entry per server with its name, label, generated_at, stale flag and probes, used to group results in the Cinder UI

See health endpoint.

Stale worker snapshots

If no worker snapshot is available within CINDER_HEALTH_AGGREGATE_MAX_AGE_SECONDS (default 180), the endpoint includes an unhealthy worker-snapshot probe and marks the worker node "stale": true, so Cinder alerts you when the worker stops reporting.