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.
Install
Section titled “Install”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.shsh pam-install.shrm pam-install.sh
pam --versionpam doctorAn existing installation updates in place:
pam self-updatepam --version # pam 2.2.27Graceful Draining
Section titled “Graceful Draining”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:
<?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.
Native PostgreSQL Client
Section titled “Native PostgreSQL Client”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_pgsqlconverts them; - SCRAM-SHA-256 and MD5 authentication;
- TLS through rustls, with
sslmodeup toverify-full; - sessions are unusable in a forked child.
Nimbus uses it when you opt in with DB_DRIVER=pam-pg. See
Database.
HTTP/2 Tuning
Section titled “HTTP/2 Tuning”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.
Nimbus 0.7 Templates
Section titled “Nimbus 0.7 Templates”pam initrequirespushinbr/arcano^0.2.9andpushinbr/nimbus^0.7.pam init --template apiwritesbootstrap/app.php, which builds and returns theNimbus\Appwithout listening, plusbin/nimbus.index.phpandtests/TestCase.phprequire the bootstrap, sobin/nimbus tinkeropens a shell over the same application.- The api and web templates add
psy/psyshtorequire-dev; the web template also getsbin/nimbus. - New package
pushinbr/nimbus-rectorwith the Rector setNimbusSetList::LARAVEL_TO_NIMBUSfor 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 indeploy/helm/nimbuswith probes,preStop, HPA and PDB.
Security Hardening
Section titled “Security Hardening”This release completes the audit of 2026-11-20.
- A dispatch protocol error (empty, duplicate or unknown request id, malformed
resume payload) answers
500instead 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
$_SERVERkey 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=1zeroes and releases pooled stacks. - Multipart bodies stop with
400past PHP’smax_multipart_body_parts(defaultmax_input_vars+max_file_uploads). url2.5.9 (RUSTSEC-2026-0592), and theDockerfilepins 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.