Performance issues #5069
Replies: 5 comments 1 reply
-
We have exactly the same problem. |
Beta Was this translation helpful? Give feedback.
-
We are also looking for a solution to a similar issue |
Beta Was this translation helpful? Give feedback.
-
Hello guys, |
Beta Was this translation helpful? Give feedback.
-
Have you tried benchmarking the Octane version without the Nginx? You don't need it anymore. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hi guys,
I am a PHP developer and currently, I am working in a company that has several (around 30) microservices. All are dockerized with a combination of NginX 1.20.1 and PHP-FPM 8.2.2 via FastCGI and run on the Lumen 10 framework. Due to various issues and limitations that this framework provides (small number of packages, limited support from the community, etc.), the management has decided to move away from this platform and replace it. There are 2 options on the table:
Both options have their pros and cons. The problem with the second option is the performance. When you migrate any application under Lumen 10 with a PHP-FPM/NginX combination to Laravel 10, it will be slower (even when you apply all the standard performance optimizations like config/route cache, commenting out all providers that you do not need, etc.). So, the only remaining option was to use Laravel Octane (https://laravel.com/docs/10.x/octane). Having read about Swoole a few years ago (https://www.zend.com/blog/swoole), I used Swoole as a server. Honestly, I was under the impression that this would fix my issue and we would be ready to migrate. However, I was mistaken and I don't know why. The Lumen app still outperforms the Laravel Octane app with Swoole. The applications are identical, so the problem must be in the config. So the config is following (both have identical Docker Compose structure):
Lumen
NginX config
PHP-FPM Dockerfile
PHP INI
Laravel Octane with Swoole
NginX config
PHP-FPM Dockerfile
PHP INI
Octane Config
Values for OCTANE_SERVER_CACHE_ROWS / OCTANE_SERVER_CACHE_ROWS_BYTES / OCTANE_SERVER - 10000 / 1000000 / swoole .
So when I run these 2 applications side by side and I execute a call to endpoint that does the same in both applications the Lumen is much faster than Laravel. The avg response time for Lumen is 737 ms and for Laravel is 1160 ms. The testing endpoints looks like this:
Lumen
Laravel
I checked the Postman HTTP response time flow and the problem is definetly on the server side:
Laravel
Lumen
Interesting fact is that when I turn off OPcache ext on both of them, Laravel Octane is much better in performance than Lumen. But why would I turn off OPcache when it is helping me, right? So I have 2 questions:
Thank you very much for your response.
Beta Was this translation helpful? Give feedback.
All reactions