← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

RoadRunner — Persistent PHP Worker

Performance PHP 8.0+ Advanced
debt(d8/e7/b7/t7)
d8 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'silent in production until users hit it' (d9), slightly better at d8 because Blackfire profiling and memory growth monitoring can surface leaks, but state-bleed bugs between requests typically only manifest under production load with no automated detection.

e7 Effort Remediation debt — work required to fix once spotted

Closest to 'cross-cutting refactor across the codebase' (e7), because adopting RoadRunner requires auditing every static property, service container reset, DB connection handling, and singleton across the entire app — not a localized change despite the simple composer require.

b7 Burden Structural debt — long-term weight of choosing wrong

Closest to 'strong gravitational pull' (b7), because once on RoadRunner every new feature must be written with awareness of request-to-request state persistence; it shapes how services, caches, and singletons are designed across web/cli/queue contexts.

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap' (t7), because the misconception explicitly states devs assume it's a drop-in PHP-FPM replacement — it contradicts PHP's foundational shared-nothing per-request model that every PHP dev internalizes.

About DEBT scoring →

Also Known As

RoadRunner persistent PHP PHP worker pool

TL;DR

Go-based server keeping PHP workers alive between requests — eliminating per-request bootstrap cost.

Explanation

RoadRunner manages long-lived PHP workers that bootstrap once (load framework, DI container) and handle multiple requests sequentially. Benefits: eliminates 20-50ms Laravel bootstrap, lower memory per request, WebSocket and gRPC support. Requires stateless PHP code with explicit state reset between requests.

Common Misconception

RoadRunner is a drop-in PHP-FPM replacement — it requires significant changes to handle stateful objects between requests.

Why It Matters

RoadRunner changes PHP's execution model fundamentally — instead of spinning up a fresh PHP process for every request, workers persist and handle multiple requests in sequence. This eliminates bootstrap overhead for frameworks like Laravel and Symfony, which can shave 50–150ms per request. The trade-off is that state must be explicitly reset between requests — static variables, service container state, and in-memory caches persist across requests unless reset, which is a common source of subtle bugs during migration.

Common Mistakes

  • Static properties accumulating between requests
  • DB connections not re-validated
  • Not resetting service container
  • Memory leaks killing workers

Code Examples

✗ Vulnerable
// FPM: 45ms bootstrap on every request
// 1000 requests = 45s in bootstrap alone
✓ Fixed
while ($request = $worker->waitRequest()) {
    $app->resetState();
    $worker->respond($app->handle($request));
}

Added 16 Mar 2026
Edited 23 Mar 2026
Views 217
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 0 pings W 3 pings T 0 pings F 2 pings S 0 pings S 1 ping M 1 ping T 4 pings W 5 pings T 1 ping F 2 pings S 4 pings S 1 ping M 3 pings T 1 ping W 1 ping T 1 ping F 6 pings S 0 pings S 0 pings M 0 pings T 3 pings W 3 pings T 2 pings F 2 pings S 1 ping S 3 pings M 3 pings T 0 pings W
No pings yet today
Google 1 ChatGPT 1 Perplexity 1
ChatGPT 100 Perplexity 40 Amazonbot 17 Google 13 Scrapy 9 Ahrefs 4 Bing 3 SEMrush 3 Unknown AI 2 Claude 2 Qwen 2 Meta AI 1 PetalBot 1
crawler 188 crawler_json 9
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: High
⚡ Quick Fix
Add RoadRunner to your PHP app with composer require spiral/roadrunner — it keeps PHP workers alive between requests eliminating bootstrap cost, giving 3-5x throughput improvement
📦 Applies To
PHP 8.0+ web cli queue-worker laravel symfony
🔗 Prerequisites
🔍 Detection Hints
High PHP-FPM bootstrap cost (heavy framework boot) with pm.max_requests hit frequently; needing WebSocket support in PHP
Auto-detectable: ✗ No blackfire roadrunner
⚠ Related Problems
🤖 AI Agent
Confidence: Low False Positives: Medium ✗ Manual fix Fix: High Context: File Tests: Update


✓ schema.org compliant