Symfony 8 on PHP 8.4: FrankenPHP vs RoadRunner Benchmarked
#Backend

Symfony 8 on PHP 8.4: FrankenPHP vs RoadRunner Benchmarked

Startups Reporter
2 min read

Comprehensive performance analysis reveals how modern PHP application servers transform Symfony execution, with FrankenPHP and RoadRunner delivering 3-4x throughput gains over traditional setups.

Featured image

The release of Symfony 7.4 LTS marks a pivotal moment in PHP development, shifting focus from framework features to deployment efficiency. Traditional NGINX + PHP-FPM setups face competition from Go-based application servers that keep PHP kernels persistently loaded. This benchmark tests the two leading contenders—FrankenPHP (Caddy-based) and RoadRunner (Spiral Scout)—running Symfony 8 on PHP 8.4 across seven real-world scenarios.

The Contenders

FrankenPHP integrates PHP directly into Caddy, collapsing web server, PHP runtime, and SSL termination into one binary. Its native Symfony integration via the Runtime component simplifies deployment, while HTTP/3 support future-proofs applications.

RoadRunner employs a worker-pool model with extensive plugins for queues, gRPC, and distributed systems. Its runtime/roadrunner-symfony-nyholm package delivers mature process management ideal for complex microservices.

Benchmark Methodology

  • Symfony 8 application with Doctrine entities and serialization
  • Test endpoints: lightweight JSON, database writes, CPU-intensive tasks
  • Hardware: 8-core CPU, 16GB RAM
  • Tool: wrk with 100 concurrent connections
  • Baseline: NGINX + PHP-FPM (PHP 8.4) featured image - Symfony 8 on PHP 8.4: FrankenPHP vs RoadRunner Benchmarked

Performance Breakdown

Scenario A: Ping (Lightweight JSON Response)

Server Requests/sec Avg Latency
PHP-FPM 2,100 45ms
FrankenPHP 8,500 4ms
RoadRunner 9,200 3ms

RoadRunner leads in raw throughput due to optimized RPC communication.

Scenario B: Database Writes

Server Requests/sec Avg Latency
PHP-FPM 850 110ms
FrankenPHP 3,200 25ms
RoadRunner 3,400 22ms

Both solutions show 3-4x improvement by eliminating framework boot overhead.

Scenario D: Large File Streaming

Server Time to First Byte Max Memory
PHP-FPM 30ms 4MB
FrankenPHP 5ms 6MB
RoadRunner 12ms 4MB

FrankenPHP's embedded architecture minimizes output buffering latency.

Architectural Tradeoffs

  • CPU-Bound Tasks: All solutions perform similarly when limited by PHP's execution speed (matrix multiplication tests showed <2% variance).
  • Memory Management: RoadRunner demonstrated lower latency jitter during heavy CPU contention, while FrankenPHP showed faster response recovery after worker recycling.
  • Streaming: Both handle 100MB+ files with flat memory curves using Symfony's StreamedResponse.

When to Choose Each

FrankenPHP excels for:

  • Single-binary deployments
  • HTTP/3-enabled projects
  • Rapid prototyping GitHub Repository

RoadRunner dominates for:

  • Microservices requiring gRPC/queues
  • High-SLA systems
  • Complex process management Documentation

Conclusion

Both servers eliminate 70%+ of PHP-FPM overhead, but their strengths differ. FrankenPHP reduces architectural complexity, while RoadRunner offers enterprise-grade extensions. For most Symfony projects, FrankenPHP lowers the performance barrier, though RoadRunner remains preferable for distributed systems.

Full benchmark source: GitHub

Comments

Loading comments...