spiral/roadrunner
RoadRunner is a high-performance PHP application server and process manager written in Go. Runs long-lived PHP workers and replaces Nginx+FPM setups. Extensible via plugins (HTTP/2/3, HTTPS, FastCGI), PSR-7/17 compatible, service-friendly.
RoadRunner (RR) is a high-performance PHP application server that replaces traditional Nginx+FPM setups, offering lower latency, better resource utilization, and extensibility via plugins. It aligns well with modern Laravel applications by:
Key Laravel integrations:
php-fpm with RR’s HTTP server (PSR-7 compatible).laravel-queue-workers) to RR’s job plugin.| Component | Feasibility | Notes |
|---|---|---|
| HTTP Server | High | Drop-in replacement for Nginx+FPM; PSR-7 middleware (e.g., Laravel’s Kernel) works out-of-the-box. |
| Queue Workers | High | RR’s job plugin supports Laravel’s queue drivers (Redis, Database, etc.). |
| gRPC | Medium | Requires protobuf extension and custom worker setup. |
| WebSockets | High | Native support or Centrifugo integration. |
| Observability | High | OTEL plugin for tracing; Prometheus metrics via middleware. |
| Workflows | Medium | Temporal plugin for complex workflows (e.g., Laravel Horizon + Temporal). |
Laravel-Specific Considerations:
RouteServiceProvider will work with RR’s HTTP plugin, but middleware must be PSR-15 compliant.sendfile middleware for efficient file serving.| Risk Area | Severity | Mitigation |
|---|---|---|
| Plugin Compatibility | Medium | Test plugins (e.g., http, jobs) with Laravel’s core components. |
| Performance Regression | Low | Benchmark against Nginx+FPM; RR is optimized for PHP 8.3+. |
| Observability Overhead | Low | OTEL plugin adds minimal latency; disable if unused. |
| gRPC Complexity | High | Requires protobuf extension and custom worker logic. |
| State Management | Medium | Ensure sessions/cache are externalized (Redis). |
| CVE Exposure | Low | RR’s Go dependencies are actively patched (see recent releases). |
| Cold Starts | Low | RR’s process manager keeps workers warm. |
App\Http\Kernel)?TrustProxies middleware for proxy IP parsing?.rr.yaml) be managed in CI/CD (e.g., GitOps)?Request/Response classes (non-PSR-7)?RoadRunner is a drop-in replacement for Nginx+FPM but requires adjustments to Laravel’s stack:
php-sockets, php-curl, php-zip, php-protobuf (for gRPC).Kernel is PSR-15 compliant).Compatibility Matrix:
| Laravel Component | RR Compatibility | Notes |
|---|---|---|
| HTTP Routing | ✅ High | PSR-7 middleware pipeline works. |
| Queues | ✅ High | Job plugin supports Laravel drivers. |
| Sessions | ⚠️ Medium | Requires external storage (Redis). |
| Caching | ✅ High | KV plugins integrate with Laravel cache. |
| gRPC | ⚠️ Medium | Requires protobuf extension. |
| WebSockets | ✅ High | Native or Centrifugo support. |
| Observability | ✅ High | OTEL plugin + Prometheus middleware. |
| Workflows | ⚠️ Medium | Temporal plugin for complex workflows. |
Phase 1: HTTP Server Replacement
.rr.yaml for HTTP server, middleware, and static files.TrustProxies).Phase 2: Queue Workers
.rr.yaml.Phase 3: Observability
Phase 4: Advanced Features
Phase 5: Deployment
.rr.yaml updates.| Priority | Task | Dependencies |
|---|---|---|
| High | HTTP Server Migration | Laravel middleware PSR-15 compliance. |
| High | Queue Worker Migration | RR job plugin + Laravel queue drivers. |
| Medium | Observability (OTEL/Prometheus) | HTTP server stable. |
| Low | gRPC Integration | Protobuf extension enabled. |
| Low | WebSockets/Broadcast | HTTP server stable. |
| Low | Temporal Workflows | Complex workflow requirements. |
sockets, protobuf) are installed..rr.yaml configuration validated.| Aspect | Impact | Notes |
|---|---|---|
| Configuration | Medium | .rr.yaml replaces Nginx/FPM configs. Requires Go/PHP knowledge. |
| Plugins | High | RR’s plugin ecosystem is extensive but requires updates. |
| Logging | Low | RR logs to stdout |
How can I help you explore Laravel packages today?