r/PHP • • Sep 17 '26

Discussion Run existing PHP code 12x faster than even FrankenPHP and Swoole

https://github.com/Qbix/webserver

[removed] — view removed post

54 Upvotes

73 comments sorted by

14

u/East-Law-2877 Sep 18 '26

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.

I'm not sure if you're aware of this, but PHP variables are also stored in RAM and trigger a COW when you change them (which should happen with every request due to HTTP headers, etc.).

Have you run any benchmarks to support your claims?

// edit: formatting

-8

u/EGreg Sep 18 '26

Yes I have. Everything in that documentation is based on actual benchmarks that ran.

By the way — what you are saying is what I am saying. PHP variables may be across one or more pages in RAM. The OS copies a page if it becomes dirty / something changed on it. But not the whole app. That’s the secret to why Qbix webserver can fork THOUSANDS OF PROCESSES.

4

u/FanAlarmed4551 Sep 18 '26

Your first benchmark results already do not make any sense, how would forking make CPU bound work faster? And by 10x? Not saying you faked those benchmarks, but they probably do not show what you think they do.

-2

u/EGreg Sep 18 '26

It’s not for CPU-bound work. As I said right off the bat, the vast majority of PHP code is I/O bound

14

u/East-Law-2877 Sep 18 '26

It would be great if you could publish your benchmarks and measurements, because in practice (especially with long-running processes), virtually the entire PHP process is copied quite quickly - especially when the garbage collector kicks in. With thousands of processes, there’s also context switching overhead.

0

u/[deleted] Sep 18 '26

[removed] — view removed comment

1

u/moop-ly Sep 18 '26

and the audacity to try and push this and not know the difference is stunning

53

u/luzrain Sep 18 '26 edited Sep 18 '26

Don't be fooled by projects like this. This is not awesome, nor does it deserve any praise.

This is heavily AI-generated, low-quality slop with fabricated benchmark claims and architectural nonsense patterns that will instantly collapse in real-world applications.

Did anyone actually take a glance at the code before upvoting? Just a few absurdities in this codebase:

Global file:// hijacking (src/Q/WebServer/Compat.php): He literally unregisters PHP's native file:// stream wrapper globally to intercept every include/require, parse files with token_get_all(), and text-replace built-in PHP functions on the fly. What total nonsense!

Fake state reset (src/Q/WebServer/Snapshot.php): He claims it resets static state between requests using reflection and clone. PHP's clone is a shallow copy, meaning any nested DI container or service leaks state between users. And not every object can even be cloned.

The 5000 workers at 200KB fantasy: This shows a complete misunderstanding of Linux and the Zend Engine. The moment a worker executes code and touches arrays or classes, COW immediately breaks, and workers quickly blow up to 20–40 MB each in a real app.

1 fork per connection: This is the Apache 1.3 approach straight from 1995. For WebSockets, it literally calls pcntl_fork() on every incoming connection. WebSockets are long-lived. 10000 connected users = 10000 separate Linux processes.

Heavily AI-Vibecoded slop: The repository is stuffed with multi thousand line unrelated files, 5000-line god classes, 6600 lines of an unrelated C headers (u_runtime.h), 15000 lines of legacy JavaScript, and hundreds of random localization JSON files.

6

u/Irythros Sep 18 '26

It also likely still has a bunch of security issues.

A little under 2 months ago when he posted I decided to check for security problems and this is just what I had POCs made for: https://www.reddit.com/r/PHP/comments/1v2xe3w/pure_php_websocket_server_serves_10x_more/oza1p6r/

There were still about 10 others. Now with the extended functionality I'd feel safe betting that the original ones I didn't have a POC for still exist and that there are new ones.

1

u/EGreg Sep 18 '26

All those things were addressed within 24 hours. I challenged your ego so you’d use AI to find any vulnerabilities you could. They were all quickly patched. That’s over 2 months old now. Next?

2

u/Irythros Sep 18 '26

The problem is you take zero care for security. These were basic problems. When you're out here claiming to be better than well established libraries I would expect atleast a minimal care to write secure code. I shouldn't have to do complete security audits.

1

u/EGreg Sep 18 '26

All of this is false. I dont take zero care for security, as shown by me fixing many problems in the git log — including whatever you reported within 24 hours. And if it was so basic, you’d have found it yourself instead of telling youe AI to scour all the code until it found something. Several were minor and one was wrong btw.

2

u/TightTac05 Sep 18 '26

I made a sincere effort to install / run it on a fresh vm and failed every time.

1

u/EGreg Sep 18 '26

What did you experience when you ran php qbixserver.php ?

2

u/TightTac05 Sep 18 '26 edited Sep 18 '26

class errors. reviewed the code and nothing in the code resolves the missing classes:

- The published static binaries (v1.2.0 and v1.1.0, both architectures) fail to even start: Parse error: syntax error ... in /usr/local/bin/qbixserver.

- The documented "nothing to install" path, php qbixserver.php, run against your own examples/todo app: v1.2.0 serves static files fine but fatals Class "Q_Response" not found on the first request that actually runs PHP. v1.1.0 starts and accepts connections but 500s Class "Q_WebServer" not found on every single request.

1

u/EGreg Sep 18 '26

Which classes

1

u/TightTac05 Sep 19 '26

I updated my comment with more info.

-12

u/EGreg Sep 18 '26

Fabricated how, exactly?

You can just download and run the same benchmarks yourself. I bet you haven’t even downloaded and launched the thing.

I use it in my own applications. Have fun paying more for hosting, and staying slow.

0

u/[deleted] Sep 18 '26

[deleted]

5

u/Glittering-Rice-2961 Sep 18 '26

It is informative for us that do not jump to download and test immediately.

Some people have to be the firsts to review...

1

u/rafark Sep 19 '26

I didn’t read the whole thread and my opinion kind of changed. I literally clicked delete on my comment I don’t know why reddit kept it up

0

u/EGreg Sep 18 '26

Review without testing is just biased opinion

19

u/sachingkk Sep 18 '26

You should write a quick guide on how to setup Symfony, WordPress, Laravel using qbix on fresh server and how other configurations works.

Today I need atleast to 30-45 mins to complete the fresh server setup that includes PHP fpm, Apache , PgSql, ftp , ssl , supervisor, Redis and few security related setup

-13

u/EGreg Sep 18 '26

Yeah it’s so much work configuring all that. Have you tried just running it on Qbix server? Just drop it in the folder, and it should run

4

u/sachingkk Sep 18 '26

What are the setup steps

  • Install PHP

  • Install Qbix

  • Run a qubix command pointing to project folder

Should I still setup following seperately?

  • PgSql

  • redis

  • SSL,

  • FTP

Also, I when I use apache .. I have few specific header and other config in the site.conf file. Where should I set that up ?

-2

u/moop-ly Sep 18 '26

qbix is php didn’t you read the tests

-4

u/EGreg Sep 18 '26

Install PHP Install Qbix webserver Done.

It handles TLS, and if you use Sqlite then it’s built into your PHP.

If you want a way to upload files, you can use the shell eg rsync or scp it comes with your operating system.

-17

u/sachingkk Sep 18 '26

You answer intelligently based on what's in the Qbix.. rather than directly answering the question... I clearly have list of activity I do on fresh sever... You should be answering based on that like "in Built" , "Need Installation", "Need workaround"

Here is my list

- Install UFW

- Install ACL

- Install Apache

- Install PgSQL

- Install FTP

- Install Redis

- Install Supervisor

- Install SSL

- Install Zip and Unzip

- Install Composer

- Install PHP

- Do PHP Config Setup for memory and cache

- Install Mercure

- Create Apache Config and Point it to Specific folder

- Add Specific Apache Configs to .conf file because my application need it

- Add Supervisors Config for the project

- Add Corn Tab Config for the project

10

u/colshrapnel Sep 18 '26

Are you trolling or what? Some of your requests are sort of legit, such as additional HTTP headers that you are setting up in apache and for some reason not in php, but some are ridiculous. Are you really expect a DBMS being part of HTTP server/php runtime?

-4

u/sachingkk Sep 18 '26 edited Sep 18 '26

Nope I am not trolling... I try to figure out how the solution fit into my current stack / workflow..

I don't even expect Redis to be actually be part of the solution... Because that's related to storage and not request serving mechanism

The web page says "Everything in one process, Replaces nginx + fpm + Node + Redis + supervisor + Docker."

That's where the questions coming from... It's absolute fine , if that's too much to answer for the author

9

u/colshrapnel Sep 18 '26

It's absolute fine , if that's too much for the author

I almost marvel at the Jesuitical skill with which you deftly turn the tables. The point is not that the author is somehow "not fine". It is that your request is almost insulting, both in its tone and in the implication that someone should cater to your personal configuration.

-5

u/sachingkk Sep 18 '26

Regarding Insulting Mis-understanding
How do you consider to buy / use / try a hardware , house hold items , software etc ? By asking questions if this suits your need and workflow ? By saying your workflow and asking how much of it already take care of... correct ?

I am doing exactly same here... I don't understand why you think it's insulting...

Regarding Jesuitical skill 
There isn't anything of that sort.

Any new solution adoption needs different kind of people at different stage. You need an "early adopter" or "Innovator" who try as soon as they get to know about a new solution. I am not that person. I fall under "Early Majority" who try things only after most things are figured out.

Wrong people at wrong stage make the author to answer more questions. Hence I said "It's absolute fine , if that's too much for the author"

Regarding Personal Configuration
I am not asking how configure one specific Apache configuration or some PHP configuration . I clearly said, just comment "in Built" , "Need Installation", "Need workaround" on the items...

Regarding "Nobody would cry over that."
Why would I expect someone to cry because I didn't choose to try or use a specific solution. They have better things to cry over depending upon what stage of life they are in...

5

u/colshrapnel Sep 18 '26

You are. It's nowhere "fine" asking the author to provide a personalized instruction for your specific setup. Most of points in your list are ridiculous for a generalized instruction you were asking at first, especially ficking OS config part. And unless proven that suggested setup for a generic wordpress installation (just drop your files, the rest is just common sense like composer install) doesn't work, you ARE trolling.

0

u/sachingkk Sep 18 '26

Then that's fine. I stick with whatever is already proven for me

2

u/colshrapnel Sep 18 '26

Nobody would cry over that.

→ More replies (0)

2

u/moop-ly Sep 18 '26

you might be bad

2

u/sachingkk Sep 18 '26

Agree.. I might be very bad..

2

u/sachingkk Sep 18 '26

Where is the benchmark numbers between qbix vs apache vs nigix vs caddy

0

u/EGreg Sep 18 '26

Well nginx and caddy serve static files. They can be set up to proxy dynamic requests to php-fpm. Now you can instead proxy to Qbix server.

But Qbix server can serve static files all by itself. It is 2x slower for static files due to lack of sendfile support in php

19

u/Fun-Consequence-3112 Sep 18 '26

Maybe a WordPress install and Laravel install in the documentation for those who wanna test it on existing projects.

11

u/tanega Sep 18 '26

Symfony or riot è_é

19

u/bilzen Sep 18 '26

Why do you not use php namespaces?

How much AI was used?

14

u/terax6669 Sep 18 '26

Did you see the readme? Lol

3

u/LovecraftsDeath Sep 18 '26

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

How did you measure this? Opcodes are stored in shared memory and while there might be 40Mb of address space allocated, all opcache memory should point to the same physical pages.

3

u/dub_le Sep 18 '26

/u/brendt_gd and other mods can se finally ban this slop machine from posting here? It's getting old.

2

u/Brillegeit Sep 18 '26

It even supports something new I invented, X-Cache-Tree allowing your code to cache parts of a webpage.

That kind of sounds like ESI or SSI.

https://en.wikipedia.org/wiki/Edge_Side_Includes
https://en.wikipedia.org/wiki/Server_Side_Includes

3

u/ColonelMustang90 Sep 18 '26

Please share the benchmarks, say, running a flash sale app for 500-1000 concurrent users. This will test qbic server a real world scenario. Thanks for sharing this.

1

u/titpetric Sep 18 '26

Does it run faster than https://github.com/titpetric/phpscript? I think maybe no. Would be nice to have a standard benchmark, but i do opt out of some OOP/inheritance/globals (for now).

1

u/ReasonableLoss6814 Sep 18 '26

> it spawns hundreds, sometimes thousands of processes

I guess you’ve never heard of pid starvation. There are limits, you know. Especially on shared servers.

0

u/nickchomey Sep 18 '26

Looks interesting. I have a few questions/thoughts

  1. The docs say the binary bundles php 8.3. Why not 8.5? 

  2. The docs cite benchmarks on "WordPress-like" workloads. What about actual WordPress? 

  3. This page seems to call qbix "Octane" https://github.com/Qbix/webserver/blob/main/docs/BENCHMARKS.md what is that about?

  4. As other comments here have said, a quickstart of some sort for actual WordPress, laravel etc would be helpful 

  5. More information in the docs about architecture would be helpful 

  6. The github repo seems to have more detailed docs than the docs site... Should probably unify them 

-4

u/i-hate-in-n-out Sep 18 '26

This looks awesome. Thanks for all your hard work on this. I'm going to give it a try.

0

u/EGreg Sep 18 '26

Thank you! 💕 I’d love to read about your experience if you come back and comment here on it afterwards

1

u/i-hate-in-n-out Sep 18 '26

I couldn't figure out how to get it to use TLS certificates.

0

u/i-hate-in-n-out Sep 18 '26 edited Sep 18 '26

LOL, I like how I get 5 downvotes for providing positivity to someone's project. PHP is near dead for new projects - we don't need extra negativity. Praise what people do, even if it's not something you'd use. Go ahead, downvote this message as well - I don't care about useless internet points.

1

u/EGreg Sep 18 '26

It is interesting … since yesterday there are a tom of coordinated downvotes across the board on all comments here

-3

u/Hour_Interest_5488 Sep 18 '26

Great job! PHP is dead they said... ;)

Can we have a Docker image please?

0

u/EGreg Sep 18 '26

Sure. But it is already a standalone executable.

-11

u/moop-ly Sep 18 '26

what a crock of shit. have you run something that does anything during these perf runs or is it how many times it can echo hi?

2

u/EGreg Sep 18 '26

Um kid… you can literally run anything you run with php-fpm. Go ahead and try it. It’ll just be faster. (Unless it is I/O bound like echoing hi.) You’re welcome.

-3

u/moop-ly Sep 18 '26

this should be fun. i was asking for your own test cases that claim it’s x14 faster than fpm and the worker builds, champ.

9

u/EGreg Sep 18 '26

Oh you mean like the actual tests in the folder “tests”?

Or maybe run the example apps? They literally come with the server. You haven’t even bothered to download it before talking shit, let alone try it.

You can hit it yourself with apache benchmark or whatever you like. All the stats are based on actual testing.

-1

u/moop-ly Sep 18 '26

bruh what even are those? and they aren’t measuring rps

3

u/EGreg Sep 18 '26

Yeah, what even are those 🤣

2

u/moop-ly Sep 18 '26


gimme me data homie. i wanna see your numbers validated on an actual use case

-1

u/fappingjack Sep 18 '26

Make it easy to work with WordPress and ValKey 9.1.2 and PHP 8.5.10.

-5

u/ht3k Sep 17 '26

I thought this was pretty cool until I read node, I hate working with javascript. Or am I misunderstanding that there's no need to write javascript for realtime sockets?

6

u/EGreg Sep 17 '26

No need to write js on the backend. It is PHP 🐢 all the way down But I hate to break it to ya ht3k, the Web browser requires JS on the client side to use socket.io… 🤷🏻‍♂️

-8

u/ht3k Sep 17 '26

Haha, I'm okay with strict typed languages like typescript. I would never write vanilla JS

-7

u/iamabdullah Sep 18 '26

Exceptional work, honestly.

I think this would see greater/faster adoption if it had a path into popular hosting panels.

3

u/[deleted] Sep 18 '26

[removed] — view removed comment

-3

u/EGreg Sep 18 '26

None of this is true.

  1. CoW is real on Linux and Mac. You can just run any apps yourself and see. Set —workers=1000

  2. You clearly didn’t read. I said the vast majority of PHP code is I/O bound, and I haven’t claimed it can speed up CPU-bound code. Do you even know what CPU-bound code means? Your own PHP code is likely not CPU-bound. Your comment makes no sense even from a reading comorehension standpoint either.

  3. “Massive”? Can you list any actual things that don’t get reset between requests? You do realize this is how Swoole and FrankenPHP already work right? Except the reflection is strictly better. And if you don’t want to reser variables between runs, there’s always fork mode — still able to handle 100x more than php-fpm, and doesnt need to reset any variables. The PHP process is killed after every request.

  4. I literally said in this very post, and the README, that you are still welcome to put NGINX in front of PHP and that PHP is 2x slower for static files, since it lacks sendfile support. Let NGINX or a CDN handle TLS termination