Skip to content

PAM 2.2.27

PAM 2.2.27 (released 2026-11-24) is the current stable runtime release. It lets your application see when its worker starts draining, ships a native PostgreSQL client for PHP, exposes HTTP/2 flow-control settings, moves the pam init templates to Nimbus 0.7, and finishes the security hardening that started in 2.2.26. For the whole 2.2 line at a glance, read the Release Notes.

Terminal window
curl --proto '=https' --tlsv1.2 --fail --silent --show-error --location \
--output pam-install.sh \
https://github.com/push-in/pam/releases/download/v2.2.27/install.sh
sh pam-install.sh
rm pam-install.sh
pam --version
pam doctor

An existing installation updates in place:

Terminal window
pam self-update
pam --version # pam 2.2.27

pam_draining() returns true once the worker that runs your code started draining: on SIGTERM, on a reload, when the worker is recycled by --max-requests, or after a wedged request. In-flight requests keep running, so a readiness endpoint can answer 503 and let the load balancer move traffic away before the worker exits:

index.php
<?php
use Pam\Http\Request;
use Pam\Http\Response;
use Pam\Http\Server;
Server::create(function (Request $request, Response $response): void {
if ($request->path === '/ready') {
$draining = function_exists('pam_draining') && pam_draining();
$response->json(['ready' => ! $draining], $draining ? 503 : 200);
return;
}
$response->json(['message' => 'Hello from PAM']);
})->listen(8080);

Nimbus’s HealthEndpoints already uses it for /ready. New cluster tests cover the behaviour: SIGTERM finishes an in-flight request and exits 0, and three reloads under load drop no request without client retries. See Request Lifecycle and Workers & Supervision.

A native Postgres client is available to PHP as pam_pg_connect, pam_pg_execute, pam_pg_transaction and related functions. It is a blocking client on the worker thread built on the postgres-protocol codec:

  • extended protocol only, always with bound parameters;
  • statements are prepared once per session (named, and closed together with their PHP statement);
  • text results are converted the same way pdo_pgsql converts them;
  • SCRAM-SHA-256 and MD5 authentication;
  • TLS through rustls, with sslmode up to verify-full;
  • sessions are unusable in a forked child.

Nimbus uses it when you opt in with DB_DRIVER=pam-pg. See Database.

Three server options tune HTTP/2 on the direct path. They apply to cleartext h2c connections and to TLS connections that negotiate h2 through ALPN:

Option Default
http2MaxConcurrentStreams 256
http2StreamWindowBytes 1 MiB
http2ConnectionWindowBytes 4 MiB

See the Configuration Reference.

  • pam init requires pushinbr/arcano ^0.2.9 and pushinbr/nimbus ^0.7.
  • pam init --template api writes bootstrap/app.php, which builds and returns the Nimbus\App without listening, plus bin/nimbus. index.php and tests/TestCase.php require the bootstrap, so bin/nimbus tinker opens a shell over the same application.
  • The api and web templates add psy/psysh to require-dev; the web template also gets bin/nimbus.
  • New package pushinbr/nimbus-rector with the Rector set NimbusSetList::LARAVEL_TO_NIMBUS for the mechanical part of a Laravel to Nimbus port.
  • An official Nimbus skeleton image, ghcr.io/push-in/nimbus-skeleton (amd64 and arm64, built on each release), and a Helm chart in deploy/helm/nimbus with probes, preStop, HPA and PDB.

This release completes the audit of 2026-11-20.

  • A dispatch protocol error (empty, duplicate or unknown request id, malformed resume payload) answers 500 instead of throwing past the C boundary. Only a real engine bailout (fatal error, memory_limit, exit) marks the worker as failed and recycles it.
  • The $_SERVER key cache holds a fixed list of common header names instead of the first 64 names the process sees.
  • maxConnections (default: the open file limit minus 256 descriptors kept for PHP) bounds the connections a worker serves; past it the worker stops accepting until one closes.
  • The inline watchdog finds the connection of a wedged request by connection id instead of peer address.
  • The Fiber stack pool only reuses stacks whose guard page the kernel applied. PAM_FIBER_STACK_POOL_SCRUB=1 zeroes and releases pooled stacks.
  • Multipart bodies stop with 400 past PHP’s max_multipart_body_parts (default max_input_vars + max_file_uploads).
  • url 2.5.9 (RUSTSEC-2026-0592), and the Dockerfile pins its base images by digest and PHP by package version.
  • CI runs cargo deny, composer audit, six fuzz targets, ASan + UBSan integration tests, CodeQL, an advisory throughput gate and a nightly RSS soak and Valgrind run.

Read the Upgrade Guide before rolling these changes out, and the Security Policy for supported versions.