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. It runs PHP apps as long-lived workers and supports plugin-based features like HTTP/2/3, HTTPS, and FastCGI with PSR-7/17 compatibility—an alternative to Nginx+FPM.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • High-Performance PHP Server: RoadRunner replaces traditional Nginx+FPM setups with a Go-based process manager, offering lower latency, higher concurrency, and reduced resource overhead. Ideal for microservices, APIs, and event-driven architectures where performance is critical.
  • PSR-7/PSR-17 Compliance: Seamlessly integrates with Laravel’s HTTP layer (via nyholm/psr7 or spiral/psr7), enabling middleware-based routing, request/response handling, and dependency injection.
  • Plugin-Driven Extensibility: Supports HTTP/2/3, gRPC, WebSockets, queues (RabbitMQ, Kafka, SQS), KV stores (Redis, Memcached), OpenTelemetry, and workflow engines (Temporal). Aligns with Laravel’s modular ecosystem (e.g., queues, caching, observability).
  • Service-Oriented Design: Acts as a process manager (like Supervisor) with auto-restart, execution time limits, and systemd-like service control, reducing operational toil.

Integration Feasibility

  • Laravel Compatibility:
    • HTTP Server: Replace php-fpm with RoadRunner’s HTTP plugin. Laravel’s Illuminate\Http\Request/Response can be mapped to PSR-7 via spiral/roadrunner-http or custom middleware.
    • Queues: Native support for Laravel Queues (e.g., queue:work can use RoadRunner’s Jobs plugin for RabbitMQ/Kafka).
    • Caching: Replace predis/php-redis with RoadRunner’s KV plugin for Redis/Memcached.
    • gRPC: Leverage Laravel’s grpc-php package with RoadRunner’s gRPC plugin for high-performance RPC.
  • Middleware Stack: RoadRunner’s HTTP middleware (e.g., gzip, prometheus, otel) can augment Laravel’s middleware pipeline (e.g., add observability without modifying Laravel code).
  • Dependency Injection: Works with Laravel’s container via PSR-11 adapters (e.g., spiral/framework or custom bindings).

Technical Risk

  • Learning Curve:
    • Go-PHP Interop: Requires understanding RoadRunner’s RPC-based worker model (vs. Laravel’s synchronous request lifecycle).
    • Configuration: .rr.yaml replaces php-fpm.conf/nginx.conf; misconfigurations may cause silent failures (e.g., wrong server.command).
  • Breaking Changes:
    • v2025 Upgrade: Laravel apps using RoadRunner v2024 may need plugin updates (e.g., KV plugin fixes in v2025.1.1).
    • gRPC/Protobuf: Requires PHP protobuf extension for optimal performance.
  • Observability:
    • Metrics/Logging: RoadRunner’s prometheus middleware must be explicitly configured; Laravel’s monolog may need adaptation.
  • Stateful Workflows:
    • Temporal Plugin: Adds distributed workflows but requires Laravel service integration (e.g., temporalio/sdk-php).

Key Questions

  1. Performance Baseline:
    • How does RoadRunner’s latency/throughput compare to current nginx+php-fpm under Laravel’s workload (e.g., API routes, queue workers)?
    • Benchmark cold starts (e.g., Laravel’s service container initialization in RoadRunner vs. FPM).
  2. Middleware Conflicts:
    • Will Laravel’s authentication middleware (e.g., auth:api) conflict with RoadRunner’s HTTP middleware order?
    • How to merge Laravel’s App\Http\Kernel middleware with RoadRunner’s (e.g., otel, gzip)?
  3. Queue Worker Migration:
    • Can Laravel’s queue:work directly use RoadRunner’s Jobs plugin without rewriting workers?
    • How to handle queue middleware (e.g., dispatchAfterResponse) in RoadRunner’s async model?
  4. Deployment Complexity:
    • How to containerize RoadRunner + Laravel (e.g., Docker multi-stage builds) while avoiding port conflicts (e.g., 8080 for HTTP, 6001 for RPC)?
    • Zero-downtime deploys: Can RoadRunner’s SIGUSR2 (graceful restart) replace Laravel Forge/Envoyer’s strategies?
  5. Observability:
    • How to aggregate RoadRunner’s Prometheus metrics with Laravel’s laravel-debugbar or Sentry?
    • Does RoadRunner’s OpenTelemetry plugin support Laravel’s stack traces (e.g., Whoops/Symfony ErrorHandler)?
  6. Plugin Stability:
    • Which RoadRunner plugins are production-ready for Laravel? (e.g., Centrifugo for WebSockets vs. Laravel Echo).
    • How to debug plugin failures (e.g., KV plugin crashes in v2025.1.0)?
  7. Cost of Adoption:
    • Go Dependencies: Does RoadRunner’s Go runtime add binary size or startup latency compared to FPM?
    • Team Skills: Does the team have Go/PHP interop experience to troubleshoot RPC issues?

Integration Approach

Stack Fit

  • Laravel Core:
    • HTTP Layer: Replace php-fpm with RoadRunner’s HTTP plugin. Use spiral/roadrunner-http for PSR-7 compatibility.
    • Queues: Migrate from database/redis queues to RoadRunner’s Jobs plugin (e.g., rabbitmq, kafka).
    • Caching: Replace predis with RoadRunner’s KV plugin for Redis/Memcached.
    • gRPC: Use Laravel’s grpc-php + RoadRunner’s gRPC plugin for high-performance RPC.
  • Observability:
    • Metrics: RoadRunner’s prometheus middleware + Laravel’s laravel-prometheus.
    • Tracing: RoadRunner’s otel plugin + Laravel’s opentelemetry-php.
  • Async Workflows:
    • Temporal: Use RoadRunner’s Temporal plugin for long-running workflows (e.g., order processing).

Migration Path

Component Current Setup RoadRunner Target Migration Steps
Web Server Nginx + PHP-FPM RoadRunner HTTP plugin 1. Add spiral/roadrunner-http to Laravel. 2. Configure .rr.yaml with http.address. 3. Replace public/index.php with PSR-7 worker.
Queue Workers queue:work (Redis/RabbitMQ) RoadRunner Jobs plugin 1. Install spiral/roadrunner-jobs. 2. Update queue.php to use RoadRunner\Jobs\JobsWorker. 3. Configure .rr.yaml with jobs.queue.
Caching Predis/Redis RoadRunner KV plugin 1. Replace Redis facade with RoadRunner\KV\KV. 2. Configure .rr.yaml with kv.redis.
gRPC Services Custom FPM setup RoadRunner gRPC plugin 1. Add spiral/roadrunner-grpc. 2. Configure .rr.yaml with grpc.proto. 3. Use Laravel’s grpc-php for service definitions.
WebSockets Laravel Echo + Pusher RoadRunner Centrifugo plugin 1. Install spiral/roadrunner-centrifugo. 2. Configure .rr.yaml with centrifugo. 3. Update Echo to use Centrifugo.
Observability Laravel Debugbar/Sentry RoadRunner otel + prometheus 1. Add spiral/roadrunner-otel. 2. Configure .rr.yaml with otel.endpoint. 3. Integrate with Laravel’s opentelemetry-php.

Compatibility

  • Laravel Versions:
    • Tested with Laravel 10.x/11.x (PSR-7 compatibility).
    • Lumen support via spiral/roadrunner-lumen.
  • PHP Extensions:

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport