Brifing

Pure PHP Server Delivers 10x Throughput vs Nginx+FPM

Alternative web server with integrated WebSocket and rooms support

Hacker News: Show HN2 min

1Introduction

Qbix Server is a pure PHP web server alternative to traditional Nginx and php-fpm stack. It can handle static files, PHP scripts, WebSocket connections, and live dashboard with a single process. This approach enables handling 10x more concurrent PHP requests on the same hardware.

2Memory Efficiency

While traditional php-fpm consumes 30-60MB per worker, Qbix Server shares framework code using copy-on-write technology. Each worker only uses additional 5MB memory. An 8GB server can handle 1600 concurrent requests instead of 160.

3Performance Benefits

Nginx+php-fpm suffers 10-50ms bootstrap overhead per request while Qbix Server forks workers after classes are loaded, eliminating bootstrap time. For static files with keep-alive, it outperforms Nginx by 120-135%.

4Integrated WebSocket

Where traditional solutions require separate WebSocket servers, Qbix Server provides built-in support. It can handle 40,000+ concurrent WebSocket connections per server, all managed by a single PHP process.

5Smart Caching

Unlike Nginx, Qbix Server supports component-level cache invalidation. The X-Cache-Tree header lets you clear cache for one component while keeping others, providing significant performance benefits for modern apps.

6Security Controls

Qbix Server offers an X-Accel-Redirect-like mechanism where PHP handles access control before the server streams the file. This enables secure file access without public URLs, with permissions managed centrally in PHP code.

7Three Execution Models

The system offers HTTP (request-response), WebSocket (persistent connection), and Room (shared state) models. All models can share the same codebase while maintaining isolation between different execution contexts.

8Easy Setup

Qbix Server runs with a single command: 'php qbixserver.php --port=8080'. Unlike Nginx, it requires no proxy_pass configuration, socket setup, or php-fpm pool tuning. You can still put Nginx or CDN in front for HTTPS and edge caching.

9Shared-Nothing Architecture

All models follow shared-nothing architecture. HTTP workers die after each request, WebSocket workers on disconnect, and Room workers when empty. This eliminates memory leaks and state bleeding between users.

10Real-Time Applications

The Room model enables building real-time multiplayer applications. Each room runs in its own process with shared state among members. Tick timers allow periodic processing - all implemented in pure PHP.

11Performance Benchmarks

In single-core container tests, it outperforms Nginx by up to 35% with keep-alive connections. 36K req/s translates to ~1800 page loads per second (assuming 20 assets per page). Zero failures across 50,000+ requests at concurrency 50.

12Future Impact

Qbix Server fills an important gap in PHP ecosystem, addressing modern web application needs with a single solution. It's particularly valuable for real-time apps and high-traffic sites, potentially changing PHP's performance perception.

Original article: Hacker News: Show HN — PHP Sunucusu ile 10 Kat Daha Fazla Performans