Runtime features

← All configuration scenarios

Enable a feature

For example, to pin workers to CPUs where the runtime supports it, save this as features.json in your application directory. Start the server with this file. Other flags inherit their defaults.

JSON
{
  "listen": { "port": 9000 },
  "feature": { "worker_cpu_affinity": "auto" }
}
Shell
php vendor/mini4work/webserver/examples/server.php features.json

Read startup diagnostics

With info logging enabled, find worker_cpu_affinity in the server.features event. configured is the requested mode, available is the runtime capability check, and enabled is the resolved flag. On an unsupported host, auto reports false for the latter two and the server continues.

Choose true when a missing capability should prevent startup, or false to disable it. On Linux, a later OS refusal to pin a worker is reported as worker.cpu_affinity.failed and the worker retains its inherited CPU mask.

Available flags

native_poll · default "auto"
Use the native polling facility when available. Encrypted stream reads still use stream selection to account for OpenSSL buffering.
tls_handshake_readiness · default "auto"
Follow OpenSSL read/write readiness during nonblocking TCP TLS handshakes.
tcp_defer_accept · default false
On Linux, defer accepting a TCP connection until client data arrives or the defer interval expires.
tls_session_resumption · default false
Allow TCP TLS clients to reuse sessions where supported. QUIC uses its own TLS stack.
worker_cpu_affinity · default false
Pin application workers to logical CPUs on Linux with PHP 8.4+ and PCNTL affinity support.

The bundled http1.json, http2.json, http3.json and auto.json profiles explicitly request automatic detection for all five flags.