hn.today

I built the fastest PHP webserver in the world

qbixserver.com3 points0 comments
Screenshot of I built the fastest PHP webserver in the world

Qbix Server is a single-file, pure-PHP web server and self-contained binary that replaces traditional stacks (nginx + PHP-FPM, Node, Redis, Docker) without extensions or adapters. It serves HTTP and WebSockets (Socket.IO protocol) on the same port, auto-generates OpenAPI docs, supports TLS, cron, buffered logging, a live dashboard, and ships six example apps. It runs unmodified WordPress, Laravel, Symfony and Drupal by shimming 28 PHP functions and reading .htaccess, so common frameworks work out of the box. The project bundles clustering with SQLite replication, per-component cache headers, rooms as forked processes, and built-in controls for access-controlled files and ETag generation.

The performance approach is technical: preload the entire application in a parent process and spawn many pcntl_fork() workers so the OS copy-on-write shares loaded classes while each worker pays only for pages it dirties. Typical workers are ~120 KB (COW), allowing hundreds or thousands of concurrent blocking workers in modest RAM; state is reset between requests via a Reflection-based snapshot (0.03 ms) and source-transformation shims. Benchmarks show large gains over php-fpm, Swoole and RoadRunner on real blocking I/O: e.g., I/O-bound 50 ms queries reach ~1,060 req/s (14× vs fpm) and 200 ms queries 488 req/s (24× vs fpm) using hundreds of workers, enabling high throughput on a single $30/month machine.

Read on qbixserver.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Web

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.