3 ms·
People have been using pcntl_fork to speed up PHP code since the 90s. It seems good on paper, can produce an "impressive" demo and falls apart quickly on real w
by dreadnip 13d ago
People have been using pcntl_fork to speed up PHP code since the 90s. It seems good on paper, can produce an "impressive" demo and falls apart quickly on real world projects and use cases. This is nothing more than LLM slop/psychosis.
- brandon272 13d agoWhat do you mean LLM slop? OP says they built it themselves.
- thrance 13d agoYeah, and surely they also wrote the 131KB unreadable-wall-of-text README themselves. That's like 1/9th Moby Dick, to put into perspective.
- EGreg 13d agoYes, I actually iterated a lot on that README and personally directed the LLM to produce every section in there, as an artifact. Normally it would produce a much shorter README, and I should probably have split it up. That is exactly what I did on the actual website. The README is no longer than nginx documentation, though, or many manfiles of programs. The README explains all the features in one file, with results of actual benchmarks. I asked it to put emojis in there as well. I use LLMs in my toolchain, same as I also use compilers. In fact, I use the LLMs to generate end-to-end test suites, and the test running is automated as well.
- thrance 13d agoI don't care how much you were or were not involved with the README, no one is reading through all that. If you can't be arsed to, at the very least, write the prose around your project, why should we devote any time engaging with it? > I use LLMs in my toolchain, same as I also use compilers. In fact, I use the LLMs to generate end-to-end test suites, and the test running is automated as well. Yeah, I could see that.
- EGreg 12d agoAlright, so version 1.3 has a much shorter README: https://github.com/Qbix/webserver https://github.com/Qbix/webserver What do you think?
- thomasmg 13d agoThere are very clear signs this was mostly built by an LLM. Just an example: https://github.com/Qbix/webserver#%EF%B8%8F-architecture https://github.com/Qbix/webserver#%EF%B8%8F-architecture misaligned lines, the commit history, etc.
- EGreg 13d agoI use LLMs in my toolchain, same as I also use compilers. In fact, I use the LLMs to generate end-to-end test suites, and the test running is automated as well.
- wavemode 13d agoover 100K lines of code materialized over the course of 3 weeks and is full of em dashes. I think we can reasonably assume here...
- EGreg 13d agoOh, it is far more useful than some “psychosis”, this is real, and battle-tested. Have you tried to download and run it yourself? It comes with its own tests and even several example apps out of the box. These examples include support for socket.io and rooms, which I highly doubt existed in the 90s. So the webserver can be used not just to serve HTTP requests to 40,000 simultaneous online users, but also have an entirely in-memory real-time chat server for 40,000 users (or anything more complex). 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. This is an entire webserver and socket server 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://github.com/Qbix/webserver https://github.com/Qbix/webserver 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! It’s not slop. It has been tested to be faster than every other PHP webserver. Here is 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. 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! Instead of hating on it, why not try it? Visit github 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