Skip to content

Worker supervision and control plane

PAM 1.0 supervises isolated worker processes on one host. The master owns generation changes, restart policy and the native control plane; application PHP never serves the admin endpoints.

Terminal window
pam start public/index.php \
--workers 8 \
--max-requests 1000000 \
--graceful-timeout 15000 \
--startup-timeout 10000 \
--restart-backoff 250 \
--watchdog-grace 250 \
--admin-address 127.0.0.1:3010

Each worker publishes an atomically replaced, versioned record containing its integer lifecycle state, deadline and bounded metrics snapshot. The master:

  • waits for the desired generation to become ready before serving it;
  • replaces crashed workers with exponential backoff;
  • recycles workers after --max-requests;
  • terminates work that remains busy past its deadline plus watchdog grace;
  • drains accepted connections on shutdown before forcing termination.

On SIGHUP, the master starts a new generation, waits for every replacement to be ready, then signals the old generation. If the replacement fails startup, only the replacement is removed and the serving generation stays alive.

The address selected by --admin-address exposes:

Path Meaning
/health Master process is alive
/ready Desired workers are ready/busy and within their deadlines
/metrics Aggregated worker counters plus PID, generation and lifecycle

Bind the admin listener to loopback or a protected operations network. Use:

Terminal window
pam top http://127.0.0.1:3010

This supervisor coordinates one host. PAM 1.0 does not ship the former experimental Pam\Cluster\RedisCoordinator, distributed locks, shared queues, presence or cross-host circuit breakers. Use infrastructure-owned discovery and coordination for multi-host deployments.

Laravel workers intentionally keep one active PHP request/callback per process because framework managers and facades can retain process-global state. Scale Laravel by increasing isolated workers, not by forcing unsafe in-process concurrency.