SH

SHOW HN: I built the fastest PHP webserver in the world

Hacker News

SHOW HN: I built the fastest PHP webserver in the world

After over a decade of writing apps in PHP, I always wondered why we needed all that extra tooling around it just to serve websites. I suspected PHP alone could be faster. I didn’t realize how right I was. It’s finally done! Two months after I initially announced it, Qbix webserver 1.2 is out. It is written in pure PHP, meaning you can run web applications without nginx for serving files and websites, certbot for certificates, cron for periodic tasks, node for realtime sockets, etc. It comes out of the box with a user friendly dashboard and control panel, too. There are even standalone binaries you can download for Linux and MacOS that can contain your entire web application: https://qbixserver.com Originally it was much faster than php-fpm, but now it is also faster than even the fastest PHP runtimes. And unlike those runtimes, it is able to run existing PHP apps without modification! First, how it can be this fast: The vast majority of PHP apps make blocking I/O calls (to the database, files, network calls etc) While that happens, the thread is blocked. FrankenPHP, Swoole, amphp and others take the “evented” approach which is much faster, but require all I/O calls to be rewritten to use their async libraries. But most existing PHP code would need a lot of work to be ported to async style, and even if it was, sometimes the async libraries don’t handle everything the mainstream ones do. Qbix Webserver takes a different approach: it spawns hundreds, sometimes thousands of processes on Linux, Mac etc. When a process is blocked waiting on I/O, the rest of the application can handle thousands of concurrent users. The reason this works is that that Qbix server allows apps to preload files and classes before it forks the worker processes. It can do this while being written in pure PHP. While php-fpm can prefork workers, this causes each worker to take up a lot of memory, eg 40MB, duplicating all the bytecode from your entire framework and app. By contrast, Qbix Webserver is able to spawn workers that are around 140KB each for a typical Wordpress app. This is because pcntl_fork on Linux and MacOS only copies on write, so 4-16KB memory pages are only copied when you make a change to a variable. If all the variables are on one page (eg in one array) you can even have workers weighing 4-16KB total, allowing you to run TENS OF THOUSANDS of workers on a 4GB machine. If you use composer install amphp, your code will use epoll instead, causing your app on Qbix Server to be even more efficient. Second, the other features: This is 2026. It would be great if your PHP was able to work with the latest socket.io and handle rooms and socket connections. Imagine a chat server that’s entirely in memory, and also able to handle 40,000 simultaneous users and connections. Well, now you can. Qbix Webserver handles HTTP Requests, Websockets and rooms, even HTTP Push (for streaming AI tokens etc). It also can manage your TLS certificates, run cron jobs, and more. It supports headers like X-Accel-Redirect which lets you serve files with access control done by your app. (Though these aren’t as fast as nginx because PHP lacks support for sendfile, so if you want additional 2x boost in speed for protected static files, you should proxy these headers to NGINX. For public static files, just use a CDN.) It even supports something new I invented, X-Cache-Tree allowing your code to cache parts of a webpage. Yes, that’s right — you are no longer required to render an entire page again if only a couple parts of it got invalidated. The X-Cache-Invalidate header can intelligently invalidate many pages at the same time! How do I try it? Visit qbixserver.com and grab the actual server. Launch it with PHP, and use the visual dashboard in your browser to manage your apps. Enjoy! It’s MIT licensed.

Share card

Actual performance

6points
1comments
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: supports · Missing: reddit linkedin, podcasting, created
97%97% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Product HuntOn track for Day 1 leaderboard · Strong signals: mac, macos, apps · Missing: agents, agent, cursor
95%95% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: exist, existing, nginx · Missing: https docs, excited, just released
85%85% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRFits verified-revenue profile · Strong signals: apps, month, users · Missing: mobile apps, ios, personal
55%55% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Strong signals: friendly, user friendly, efficient · Missing: plus, platform, intuitive
50%50% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: arr · Missing: mrr, revenue, profit
21%21% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Strong signals: chat · Missing: web3, crypto, cryptocurrency
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

I
I built a PHP wrapper for the FancyHands API39%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I built a PHP wrapper for the FancyHands API

Hacker News2
It
Iterated Prisoner's Dilemma (in PHP)38%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Iterated Prisoner's Dilemma (in PHP)

Hacker News3
I
I wrote a SCSS compiler in PHP53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I wrote a SCSS compiler in PHP

Hacker News4
PH
PHP lib for Buffer - bufferapp-php33%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

PHP lib for Buffer - bufferapp-php

Hacker News3
My
My standalone PHP Debugger68%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

My standalone PHP Debugger

Hacker News12
Bo
Bootstrap 3 and PHP put together44%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Bootstrap 3 and PHP put together

Hacker News1
Ex
Expressjs implemented in PHP50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Expressjs implemented in PHP

Hacker News2
Me
Metaprogramming in PHP without eval. Still evil? Hells yeah it is.47%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Metaprogramming in PHP without eval. Still evil? Hells yeah it is.

Hacker News2
AS
AST for PCRE Regex in PHP36%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

AST for PCRE Regex in PHP

Hacker News2
Ja
Java to PHP Compiler41%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Java to PHP Compiler

Hacker News7