is ngx-phpworker similar to workerman/adapterman ?
@budipriyatno58533 күн бұрын
I'd prefer frankenphp worker mode
@DevHau9 күн бұрын
2025 the php is dead. the end.
@RahmaTVIndo20 күн бұрын
Nice video! love it
@user-uk9er5vw4cАй бұрын
this was very nice
@umardev5002 ай бұрын
Now PHP is irrelevant and obsolete compared with it's competitor
@francomputos2 ай бұрын
toooooooooooooooooooooooooooooo FAST
@winfle3 ай бұрын
Дякую за огляд!
@seqgame74103 ай бұрын
`Hello world` test is a test that will never be applicable to a real world app. Swoole has coroutines, async db queries, workers for tasks. What result will ngx-php show when querying the database, while swoole continues to handle other connections while the database query is running? (Unfortunately, this is not implemented in Laravel Octane)
@pronskiy3 ай бұрын
@@seqgame7410 Those are valid concerns indeed. By default, ngx-php worker would wait, but in theory it is possible to do asynchronous db queries. It requires changing the architecture tho just like with swoole. So here I was thinking about “can we through something on it real quick and get performance boost?”
@ROX23 ай бұрын
What about ecosystem ? swoole has upd,tcp,websockets integrated and on my opinion its a killer feature combined with prety nice performance with easy setup and run. Swoole is my choice. But your benchmark interesting too. Feed for thought.
@pronskiy3 ай бұрын
Agree, I had a bit of experience with Swoole components and Hyperf and it was a pleasure to work with. What do you think is preventing more people from trying/using it?
@ROX23 ай бұрын
@@pronskiy i think first of all it all about php curse - old and absolutely wrong tutorials and learning materials that propaganda bad practices, bad code style, and of course - ignoring security issues. And i tell about overengineering examples too :) We also does not have enough public example of successful projects that use something else instead of php-fpm (but i know some). I personaly have expirience of development PHP Swoole UDP socket based backend server for multiplayer game used Unity game engine and it work great with a huge performance capacity! FPM desined to die in end, like php self. Using roadruner, Swoole etc, force you to worry about memory leaking and made something to restart process manualy or automatic if something goes wrong. This add some complexicity. BTW i see some good libraries in your monthly digest wich use CLI and i think this side of PHP underrated too like and other php application servers. PHP-FPM also has good feature - instant apply changes on save (if opcache disabled of course :D). Another approaches require restarting processes or using some third-party automation solutions. To summarize, I agree that FPM is easier for smaller projects that don't need to break stars from the sky, and solutions like Swoole are great for comparing with GO in many cases
@sam_dark3 ай бұрын
Awesome video. Thank you!
@CutCodeRu3 ай бұрын
great video thank you! I want to see more of you in the frame and more videos like this! we are waiting more
@pronskiy3 ай бұрын
@@CutCodeRu thank you for support, guys! 🫶
@ipopov893 ай бұрын
please integrate that ssh interface for starbucks !!!
@lileightright4 ай бұрын
1995: Building a new language in C to help you deliver projects to clients faster. 2024: Crafting the perfect prompt so AI can understand you and fix your JavaScript framework issues.
@kdunglas4 ай бұрын
Raw PHP performance is only part of the story. In real-life apps, enabling HTTP/3, compressing responses with modern formats such as Zstandard or Brotli, and using Early Hints will usually have a bigger impact on performance. FrankenPHP supports all of this by default!
@pronskiy4 ай бұрын
Happy to see you here, Kevin! And kudos for FrankenPHP and all of your work!
@MaulikParmar2104 ай бұрын
Forgot to mention that they all run as single application server binary ( thanks custom caddy build) unlike other solutions loading modules on runtime and require proper runtime setup. This is much more compact and can be tuned to individual needs for easy app deployment with single binary in image / deployment and few data mount points. Roadrunner is slight faster in raw performance because of goridge comapred to cgo sapi so it bypasses alot of runtime sapi code, this is expected to improve over time when SAPI itself will improve and php will depart from fpm era and become more general purpose language. Also in franken one can enjoy entire caddy ecosystem as an added bonus. The raw performance doesn't necessarily mean better throughput, most real world apps will be blocked by IO rather than available CPU where DB is the slowest to respond even if responses come under sub 5 milisecond range. The app will indefinitely wait in such cases. Would love to see sub 1ms range timings but it will take alot of efforts to systematically clean core runtime and add missing features like OS backed IPC, native threading, sync mechanisms to advance the development. Always good to see you in the community, thank you for giving us real frankenstien of php world, the name suits the solution 👍🏻
@techrevolution14083 ай бұрын
@@MaulikParmar210 I really love Frankenphp. Selfcontained executable is game changer for me.
@lemeshenko4 ай бұрын
You have memory leaks because of Laravel. It is not properly implemented for long running tasks. You need to use octane to properly clear the state.
@pronskiy4 ай бұрын
@@lemeshenko I do use Octane. You can check the code on GitHub pronskiy/ngx-php_laravel
@kruhlyk_ua4 ай бұрын
As for me FrankenPHP is cool but it's not ready to use in production/ Swoole looks like more stable solution.
@pronskiy4 ай бұрын
@@kruhlyk_ua agree. FrankenPHP is promising but not as mature as Swoole
@kdunglas4 ай бұрын
If you encounter issues with FrankenPHP, please open an issue. We fixed most of the known issues but a few (usually caused by buggy third-party extensions) remain.
@pronskiy4 ай бұрын
@@kdunglas thanks, Kevin. Is there a list of the buggy extensions somewhere?
@voidmind4 ай бұрын
Wow 100+ lines of code to proxy HTTP requests. It's not making me want to take a look back at PHP
@maisei884 ай бұрын
Рома спасибо большое за видео 🤗
@pronskiy4 ай бұрын
🫶💜
@midgardresident4 ай бұрын
is opcache enabled when running php-fpm?
@shkabo4 ай бұрын
I'd like to see this vid with symfony now :)
@raiyansarker4 ай бұрын
the best you can get is 300 rps? PHP is great, just not the performance!
@winfle4 ай бұрын
No, on my machine I have around 12k RPS on rr with 12 workers
@raiyansarker4 ай бұрын
@@winfle I believe you won't deploy on a server somewhere near that specs!
@theshinyplayer23734 ай бұрын
I'm sorry, but there are som extreme issues with your testing. I did a quick test on a 5 year old machine, and I'm getting 12K rps on the default Laravel landing page with Swoole. That's around 50x your results. Here are some of the issues: 1. You're running on macos. That's not at all what people actually run their sites on. You might even be running on a different arch if your PC is ARM. 2. You're using docker. Docker does not have much overhead, normally. However, since you're on macos you're running docker in a VM, and the biggest issue is that you're using bind mounts. This isn't a issue on Linux, but on Windows and macos it's insanely slow. Move all your files into the container as part of the image, that helps. 3. You're probably just benchmarking sqlite as Laravel uses it for session storage by default. If you look at CPU usage during benchmarking you'll most likely see that your computer is mostly idle. Use something more realistic, like MariaDB or Redis, to reduce the storage bottleneck. CPU usage should be 100 % if you're benchmarking PHP execution. 4. You might not be running artisan optimize or optimizing the composer autoloader. Maybe you're also running Laravel in debug mode? All these things are things that are normal to do for an actual website, so the number you're getting are very unrealistic. Getting realistic numbers needs to be done on a realistic setup. Benchmarking and profiling software on a different OS(or arch) to the one that will be used in prod can give very wrong.
@pronskiy4 ай бұрын
@@theshinyplayer2373 thanks for bringing this up. Indeed, I believe all of your concerns are true. The code of benchmarks is available at GH/pronskiy/ngx-php_laravel so I’d be happy if you help improve it. I plan to rerun it to get more accurate numbers. I wouldn’t like to remove Docker though, cause it makes things much easier. Also techempower also run their benchmarks with Docker so, as you said, maybe running on Linux would help.
@lemeshenko4 ай бұрын
Why not to run it on vps. This will be closest to the real life scenario
@duongphuhiep2 ай бұрын
agree that the numbers are unrealistic because of the infrastructure (macOs, docker...) However the point is to compare them under the same infrastructure condition to see the relative differences. This video gives us a general idea about the gaps between them
@theshinyplayer23732 ай бұрын
@@duongphuhiep That's the problem, it doesn't work at all for a comparison that is relevant for a production env. When disk access is this slow it quickly becomes the bottleneck, and if some software uses the disk less it might get way ahead in these benchmarks while still being slower in a production env where the disk access is orders of magnitude faster and something else becomes the bottleneck.
@husnixs14 күн бұрын
@@pronskiy maybe you can test with CMS like wordpress. let's see who is the fast
@markusTegelane4 ай бұрын
I like how the dollar sign prefix for variable names has been there since the beginning
@MrWancer4 ай бұрын
Thanks for the video It's really interesting what modern ways of running php app exists nowdays and how fast & different they are If you would have some extra time, it would be interesting to see if build-in optimizations would affect performance somehow. - php-fpm pm.* - jit - opcache - preload - disabling circular reference collector (gc) - that's interesting one. It should be fine to have it disabled for php-fpm, but for other ways of running - not sure.
@pronskiy4 ай бұрын
Oooo thanks for this list! Now I have the next challenge: squeeze the best out of php-fpm with all the optimizations.
@romanpronskiy4 ай бұрын
I tried to add some optimisations in the repository. OPcache helps a lot indeed, but it seems like more can be done to improve it.
@tarilonte4 ай бұрын
If someone chooses Laravel it is because they have given up on performance.
@Denakino4 ай бұрын
Sure, Laravel is not the fastest, but it is more than fast enough for about 99% of cases.
@pronskiy4 ай бұрын
There’s some truth to that - I’d agree that Laravel's strength is in development speed rather than extreme performance. But that doesn’t mean you can’t challenge yourself to make it as fast as possible.
@helioao4 ай бұрын
“I don’t understand something that’s why I hate it”
@lemeshenko4 ай бұрын
Pure laravel executes in 40-50 ms, which is comparable with 20 ms of, for example, Net core
@medilies4 ай бұрын
Where does Apache fit in the benchmark?
@pronskiy4 ай бұрын
I haven't benchmarked it yet. My gut feeling is that it will be a bit slower than php-fpm. If you have some time, feel free to send a PR with a dockerfile to GH/pronskiy/ngx-php_laravel
@CutCodeRu4 ай бұрын
Excellent video, php-fpm top) we are waiting for more content from you
@pronskiy4 ай бұрын
thank you, folks 🫶
@a_vldm4 ай бұрын
That's awesome! I hope there will be more videos on the channel!😇
@haliszekeriyaozkok48514 ай бұрын
İncredible, it was designed like a framework from day 1 and then became another language.
@klausschmidt9824 ай бұрын
Funny intro, i guess you don’t know how much people talked about AI in the 80s or 50s to 60s.
@pronskiy4 ай бұрын
Do you mean in academical circles?
@klausschmidt9824 ай бұрын
@@pronskiy nah, this went much further than just academia. You have to keep in mind this was in a time before the internet and Big Tech. If you are interested I could do a little write up but I am afraid that this would be a bit long for a KZbin comment.
@DrChuckPlus4 ай бұрын
Cool - I see some clips from my Rasmus Lerdorf Interview - a link would be nice :)
@pronskiy4 ай бұрын
Thank you for the interview! I added the link in the description.
@DrChuckPlus4 ай бұрын
@@pronskiy By the way - I loved this video.
@siniorgolazo4 ай бұрын
I'm sorry but I stopped using PHP when you guys got rid of the "T_PAAMAYIM_NEKUDOTAYIM" exception :(
@1987alejandroivan4 ай бұрын
I thought classes weren’t available until PHP 4?
@pronskiy4 ай бұрын
@@1987alejandroivan they were not indeed
@ZapOKill4 ай бұрын
PTSD trigger warning needed!
@MarkoBolliger4 ай бұрын
ok since v1 there are not much changes xD jk
@seriouslyWeird5 ай бұрын
this channel is supposed to be played at 1.5x speed
@sharpenednoodles5 ай бұрын
PHP is great - the real crime is WordPress
@jan_harald5 ай бұрын
cgi is the best thing since sliced bread and php still supports it, because it's the best! tho you'd normally use fastcgi instead, nowdays
@zerocoll205 ай бұрын
It looks like how things are developed today, lol.
@Jelle-DV5 ай бұрын
Super interesting to see it in action!
@PiotrFilipek5 ай бұрын
Hi! I see you use a MacBook Pro. What model do you recommend to advanced programming? I have been using Ubuntu for many years and I want to switch to Mac, but I don't know what spec I should choose. In my daily work I use PHP with PHPStorm, SQL client, Dockers, mail client, MS Teams, Spotify, Todo app, etc. I am most interested in your opinion on RAM.
@pronskiy5 ай бұрын
I have a MacBook Pro, 14-inch, 2021 with the Apple M1 Max and 32 GB of RAM, and I absolutely love it! The performance, battery life, and screen are all fantastic. The only potential downsides are the Apple ecosystem and the price. But if those aren't deal-breakers for you, it's a great choice. As for RAM, I think for dev needs 32GB or more is great, 16GB could be ok too, but I wouldn't go less than that.
@soniablanche56725 ай бұрын
did this dude really just run php 1.0 with a server written with php ?
@mandokir5 ай бұрын
Good video 🙂 Nice speedrun.
@taintedtapper5 ай бұрын
Hi Roman! Just wanted to know what your IDE in this video was? Thanks.
@pronskiy5 ай бұрын
@@taintedtapper it's PhpStorm
@anna-plink5 ай бұрын
I had no idea PHP is older than me 😂
@MilMike5 ай бұрын
really cool! brings back memories.
5 ай бұрын
I've started using php from version 3. Already forgot that PHP means Personal Home Page 😆
@turbo2ltr5 ай бұрын
Been writing php since the early/mid 2000s. Even have a php tattoo. I don't understand all the hate it gets. Unlike the countless "modern" frameworks that need additional frameworks to fix the frameworks. I never liked frameworks, even php frameworks because they always locked you in some how.. Yes it might be more work, but I like the low level aspect of php. I can always do EXACTLY what I need to do.
@jan.tichavsky5 ай бұрын
I used to write PHP some 20 years ago, made my own photogallery with multiple users contributing photos and comments. But those were just hobby projects. Couple months ago I started to realize my new project so even I hardly used PHP in between it was still my natural choice. Quick to prototype working solution and get it running couple pages, like you say, without any framework needed. Every minute it keeps parsing real time transport data and saving the info into PostgreSQL which I haven't used before. Fun project and it keeps running on its own without major issues.