Skip to content
Tech News
← Back to articles

I built the fastest PHP webserver in the world

read original more articles
Why This Matters

This story highlights a clever userland PHP technique that could dramatically improve performance for the vast majority of legacy PHP code using blocking I/O, without requiring developers to rewrite their applications for async frameworks. By leveraging copy-on-write memory sharing via pcntl_fork(), it promises far greater concurrency at a fraction of the memory cost of traditional PHP-FPM setups, which matters for hosting costs and scalability across the huge WordPress/Laravel ecosystem.

Key Takeaways

The vast majority of PHP code — WordPress plugins, Laravel packages, every PDO::query() and file_get_contents() ever written — uses blocking I/O. Swoole’s coroutines can’t help with code that doesn’t yield. FrankenPHP and RoadRunner use the same worker-count-limited model as fpm.

Qbix takes a different approach: run many workers. The server loads your entire framework into a parent process, then calls pcntl_fork() to create workers. The kernel marks the parent’s pages copy-on-write. Workers share every loaded class — they only pay for pages they actually write to during the request.

A WordPress-like request dirties 30 pages = 120KB on Linux. So 200MB doesn’t buy 4 workers (like fpm) — it buys thousands. Each one blocks on its database query, and that’s fine. Blocking I/O doesn’t matter when you have enough workers. COW is what makes “enough workers” cost 47MB instead of 16GB.

This is pure userland PHP. No kernel module, no C extension, no custom allocator. Just pcntl_fork() after loading everything, and the OS does the rest.