`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)
@pronskiy
13 күн бұрын
@@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?”
@ROX2
13 күн бұрын
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.
@pronskiy
13 күн бұрын
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?
@ROX2
13 күн бұрын
@@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_dark
14 күн бұрын
Awesome video. Thank you!
@CutCodeRu
14 күн бұрын
great video thank you! I want to see more of you in the frame and more videos like this! we are waiting more
@pronskiy
14 күн бұрын
@@CutCodeRu thank you for support, guys! 🫶
@ipopov89
15 күн бұрын
please integrate that ssh interface for starbucks !!!
@lileightright
Ай бұрын
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.
@kdunglas
Ай бұрын
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!
@pronskiy
Ай бұрын
Happy to see you here, Kevin! And kudos for FrankenPHP and all of your work!
@MaulikParmar210
Ай бұрын
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 👍🏻
@techrevolution1408
10 күн бұрын
@@MaulikParmar210 I really love Frankenphp. Selfcontained executable is game changer for me.
@lemeshenko
Ай бұрын
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.
@pronskiy
Ай бұрын
@@lemeshenko I do use Octane. You can check the code on GitHub pronskiy/ngx-php_laravel
@oleksii_letscode
Ай бұрын
As for me FrankenPHP is cool but it's not ready to use in production/ Swoole looks like more stable solution.
@pronskiy
Ай бұрын
@@oleksii_letscode agree. FrankenPHP is promising but not as mature as Swoole
@kdunglas
Ай бұрын
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.
@pronskiy
Ай бұрын
@@kdunglas thanks, Kevin. Is there a list of the buggy extensions somewhere?
@voidmind
Ай бұрын
Wow 100+ lines of code to proxy HTTP requests. It's not making me want to take a look back at PHP
@maisei88
Ай бұрын
Рома спасибо большое за видео 🤗
@pronskiy
Ай бұрын
🫶💜
@midgardresident
Ай бұрын
is opcache enabled when running php-fpm?
@shkabo
Ай бұрын
I'd like to see this vid with symfony now :)
@raiyansarker
Ай бұрын
the best you can get is 300 rps? PHP is great, just not the performance!
@winfle
Ай бұрын
No, on my machine I have around 12k RPS on rr with 12 workers
@raiyansarker
Ай бұрын
@@winfle I believe you won't deploy on a server somewhere near that specs!
@theshinyplayer2373
Ай бұрын
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.
@pronskiy
Ай бұрын
@@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.
@lemeshenko
Ай бұрын
Why not to run it on vps. This will be closest to the real life scenario
@markusTegelane
Ай бұрын
I like how the dollar sign prefix for variable names has been there since the beginning
@MrWancer
Ай бұрын
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.
@pronskiy
Ай бұрын
Oooo thanks for this list! Now I have the next challenge: squeeze the best out of php-fpm with all the optimizations.
@romanpronskiy
Ай бұрын
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.
@tarilonte
Ай бұрын
If someone chooses Laravel it is because they have given up on performance.
@Denakino
Ай бұрын
Sure, Laravel is not the fastest, but it is more than fast enough for about 99% of cases.
@pronskiy
Ай бұрын
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.
@helioao
Ай бұрын
“I don’t understand something that’s why I hate it”
@lemeshenko
Ай бұрын
Pure laravel executes in 40-50 ms, which is comparable with 20 ms of, for example, Net core
@medilies
Ай бұрын
Where does Apache fit in the benchmark?
@pronskiy
Ай бұрын
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
@CutCodeRu
Ай бұрын
Excellent video, php-fpm top) we are waiting for more content from you
@pronskiy
Ай бұрын
thank you, folks 🫶
@a_vldm
Ай бұрын
That's awesome! I hope there will be more videos on the channel!😇
@haliszekeriyaozkok4851
Ай бұрын
İncredible, it was designed like a framework from day 1 and then became another language.
@klausschmidt982
2 ай бұрын
Funny intro, i guess you don’t know how much people talked about AI in the 80s or 50s to 60s.
@pronskiy
2 ай бұрын
Do you mean in academical circles?
@klausschmidt982
2 ай бұрын
@@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 KZitem comment.
@DrChuckPlus
2 ай бұрын
Cool - I see some clips from my Rasmus Lerdorf Interview - a link would be nice :)
@pronskiy
2 ай бұрын
Thank you for the interview! I added the link in the description.
@DrChuckPlus
Ай бұрын
@@pronskiy By the way - I loved this video.
@siniorgolazo
2 ай бұрын
I'm sorry but I stopped using PHP when you guys got rid of the "T_PAAMAYIM_NEKUDOTAYIM" exception :(
@1987alejandroivan
2 ай бұрын
I thought classes weren’t available until PHP 4?
@pronskiy
2 ай бұрын
@@1987alejandroivan they were not indeed
@ZapOKill
2 ай бұрын
PTSD trigger warning needed!
@MarkoBolliger
2 ай бұрын
ok since v1 there are not much changes xD jk
@seriouslyWeird
2 ай бұрын
this channel is supposed to be played at 1.5x speed
@sharpenednoodles
2 ай бұрын
PHP is great - the real crime is WordPress
@jan_harald
2 ай бұрын
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
@zerocoll20
2 ай бұрын
It looks like how things are developed today, lol.
@Jelle-DV
2 ай бұрын
Super interesting to see it in action!
@PiotrFilipek
2 ай бұрын
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.
@pronskiy
2 ай бұрын
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.
@soniablanche5672
2 ай бұрын
did this dude really just run php 1.0 with a server written with php ?
@mandokir
2 ай бұрын
Good video 🙂 Nice speedrun.
@taintedtapper
2 ай бұрын
Hi Roman! Just wanted to know what your IDE in this video was? Thanks.
@pronskiy
2 ай бұрын
@@taintedtapper it's PhpStorm
@anna-plink
2 ай бұрын
I had no idea PHP is older than me 😂
@MilMike
2 ай бұрын
really cool! brings back memories.
2 ай бұрын
I've started using php from version 3. Already forgot that PHP means Personal Home Page 😆
@turbo2ltr
2 ай бұрын
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.tichavsky
2 ай бұрын
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.
@MaxCupertino-gf5ht
2 ай бұрын
Love you php Love this video ❣️❣️❣️❣️❣️
@GuruEvi
2 ай бұрын
I remember that era. A lot more was left over to the developer/sysadmin. The problem with lots of forms of that era was zero input validation. You saved form results as the video shows, but you often had the username or e-mail as the form name, which means that if you input /etc/passwd you can actually input a valid password file. Nowadays that would be a major issue, back then it was blown of as: just don’t give your web server those permissions.
@namaefumei
3 ай бұрын
Great video! Would love to see a video about the history of web from dev perspective
@ROX2
3 ай бұрын
Прикольный эксперимент, ужасы компиляции остались за кадром
@pronskiy
2 ай бұрын
Кстати нет :-) На удивление стандартный компилятор GCC на маке справился вообще без проблем с кодом 29-летней давности.
@sparkytoday3
3 ай бұрын
Loved your video as a noob in php seeing this video was just WOW.
@filpvl
3 ай бұрын
Wow, it was surprising to see this in 2024 ) Roman 🫶
@pronskiy
2 ай бұрын
Glad to hear from you Pavlo 🫶
@dynamohack
3 ай бұрын
those who love php i love them and coincidentally my birth is same as php and i am so glad to know this
Пікірлер