Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Roadrunner Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

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:

  • PSR-7/PSR-17 compliance: Native support for HTTP/2/3, WebSockets, and middleware (e.g., gzip, Prometheus, OTEL).
  • Process management: Built-in worker pooling, auto-restarts, and execution time limits reduce operational overhead.
  • Protocol diversity: Supports HTTP, gRPC, fCGI, queues (RabbitMQ, Kafka, SQS), and KV stores (Redis, Memcached).
  • Observability: OpenTelemetry integration for distributed tracing, metrics, and logging.
  • Workflow engine: Temporal.io support for long-running workflows (useful for Laravel Queues or sagas).

Key Laravel integrations:

  • Replaces php-fpm with RR’s HTTP server (PSR-7 compatible).
  • Can offload queue workers (e.g., laravel-queue-workers) to RR’s job plugin.
  • Supports gRPC for high-performance APIs (e.g., Laravel Fortify or custom APIs).
  • Enables WebSockets/Broadcast via Centrifugo or native plugins.

Integration Feasibility

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:

  • Routing: Laravel’s RouteServiceProvider will work with RR’s HTTP plugin, but middleware must be PSR-15 compliant.
  • Session/State: RR’s stateless design requires external storage (Redis) for sessions.
  • File Uploads: Use RR’s sendfile middleware for efficient file serving.
  • Caching: KV plugins (Redis/Memcached) integrate seamlessly with Laravel’s cache drivers.

Technical Risk

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.

Key Questions

  1. HTTP Server:
    • How will RR’s HTTP plugin interact with Laravel’s middleware pipeline (e.g., App\Http\Kernel)?
    • Can RR handle Laravel’s TrustProxies middleware for proxy IP parsing?
  2. Queue Workers:
    • Will RR’s job plugin support Laravel’s queue retries, failures, and events?
    • How does RR’s worker pooling compare to Laravel Horizon’s supervision?
  3. gRPC:
    • Is protobuf extension enabled in the PHP environment?
    • How will gRPC services integrate with Laravel’s service container?
  4. WebSockets:
    • Does Centrifugo integration conflict with Laravel Echo/Pusher?
  5. Observability:
    • How will OTEL traces correlate with Laravel’s logging (Monolog)?
  6. Deployment:
    • How will RR’s configuration (.rr.yaml) be managed in CI/CD (e.g., GitOps)?
    • Can RR’s systemd-like service manager replace Supervisor for Laravel workers?
  7. Scaling:
    • How will RR’s horizontal scaling (multiple instances) handle shared state (e.g., cache)?
  8. Legacy Code:
    • Will RR break Laravel’s legacy Request/Response classes (non-PSR-7)?

Integration Approach

Stack Fit

RoadRunner is a drop-in replacement for Nginx+FPM but requires adjustments to Laravel’s stack:

  • PHP: 8.3+ (recommended for performance).
  • Extensions: php-sockets, php-curl, php-zip, php-protobuf (for gRPC).
  • Go: 1.25+ (for RR binary).
  • Dependencies:
    • PSR-7/PSR-15 compliant middleware (Laravel’s Kernel is PSR-15 compliant).
    • External storage for sessions/cache (Redis, Memcached).
    • Optional: OTEL collector for distributed tracing.

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.

Migration Path

  1. Phase 1: HTTP Server Replacement

    • Replace Nginx+FPM with RR’s HTTP plugin.
    • Configure .rr.yaml for HTTP server, middleware, and static files.
    • Test PSR-7 middleware pipeline (e.g., auth, CORS).
    • Risk: Middleware conflicts (e.g., TrustProxies).
  2. Phase 2: Queue Workers

    • Migrate Laravel queue workers to RR’s job plugin.
    • Configure queue drivers (Redis, Database) in .rr.yaml.
    • Test retries, failures, and events.
    • Risk: Worker pooling differences vs. Horizon.
  3. Phase 3: Observability

    • Enable OTEL plugin for distributed tracing.
    • Add Prometheus middleware for metrics.
    • Risk: Trace correlation with Laravel logs.
  4. Phase 4: Advanced Features

    • Add gRPC for high-performance APIs.
    • Integrate WebSockets (Centrifugo or native).
    • Implement Temporal workflows for complex logic.
    • Risk: gRPC complexity; workflow learning curve.
  5. Phase 5: Deployment

    • Replace Supervisor with RR’s service manager.
    • Configure CI/CD for .rr.yaml updates.
    • Risk: Configuration drift.

Sequencing

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.

Compatibility Checklist

  • Laravel middleware is PSR-15 compliant.
  • PHP extensions (sockets, protobuf) are installed.
  • External storage (Redis) for sessions/cache.
  • .rr.yaml configuration validated.
  • Queue drivers tested with RR’s job plugin.
  • gRPC services (if applicable) protobuf-ready.

Operational Impact

Maintenance

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
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai