# Pure PHP Server Delivers 10x Throughput vs Nginx+FPM

Alternative web server with integrated WebSocket and rooms support

- **Source:** [Hacker News: Show HN](https://news.ycombinator.com)
- **Published:** 2026-07-21
- **Topic:** [Software & Engineering](https://brifing.si/c/engineering)
- **Original article:** <https://github.com/Qbix/webserver>
- **On Brifing:** https://brifing.si/s/fde3231c-6738-4d56-9d61-168898781b8c

## Introduction

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.

## Memory 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.

## Performance 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%.

## Integrated 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.

## Smart 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.

## Security 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.

## Three 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.

## Easy 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.

## Shared-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.

## Real-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.

## Performance 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.

## Future 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.

## Sources covering this story

- https://github.com/Qbix/webserver — 

---

_Summary written by Brifing from the original reporting. Copyright in the original article belongs to its publisher; read the full piece at the link above._
