RoadRunner — Persistent PHP Worker
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));
}
References
Tags
🤝 Adopt this term
£79/year · your link shown here
Added
16 Mar 2026
Edited
23 Mar 2026
Views
135
🤖 AI Guestbook educational data only
|
|
Last 30 days
Agents 1
ChatGPT 1
No pings yesterday
ChatGPT 72
Perplexity 24
Amazonbot 14
Google 8
Unknown AI 2
Ahrefs 2
Also referenced
How they use it
crawler 119
crawler_json 3
Related categories
⚡
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