Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add performance advanced solutions #17428

Closed
raziel057 opened this issue Nov 11, 2022 · 11 comments
Closed

Add performance advanced solutions #17428

raziel057 opened this issue Nov 11, 2022 · 11 comments

Comments

@raziel057
Copy link
Contributor

As we can see more and more solution trying to run Symfony with async event driven or other modern servers (swoole, openswoole, amp, workerman, frankenphp), it would be interesting to provide tips or links to the different solutions. It could be added in a specific section of the https://symfony.com/doc/current/performance.html page.

Frankenphp and Workerman support with AdapterMan seems particularly interesting (see last benchmark here). It use the exact same code.

Maybe it would make sense to increase the popularity of these solutions, by providing advises (pro/cons).

References
https://frankenphp.dev/
https://github.com/joanhey/AdapterMan
https://github.com/walkor/workerman
https://openswoole.com/
https://github.com/swoole/swoole-src

@joanhey
Copy link

joanhey commented Nov 28, 2022

Added Frankenphp to the bench.
TechEmpower/FrameworkBenchmarks#7748

Now only in normal mode with plain php.
Later I'll try with Worker mode and Symfony.

@joanhey
Copy link

joanhey commented Nov 29, 2022

Added Symfony Swoole using phpruntime
TechEmpower/FrameworkBenchmarks#7753

@raziel057
Copy link
Contributor Author

@joanhey thank you. Good to see viable solutions that improves performances of high quality PHP Frameworks.

@joanhey
Copy link

joanhey commented Nov 30, 2022

Added Symfony with Frankenphp in Worker mode using phpruntime
TechEmpower/FrameworkBenchmarks#7756

@javiereguiluz
Copy link
Member

@joanhey thanks for working on this 🙏

Just out of curiosity, how are the numbers that you see when running these benchmarks on your local machine? How much faster is the app when running via FrankenPHP? Thanks.

@joanhey
Copy link

joanhey commented Nov 30, 2022

Hola Javier

Normally I don't bench locally because it's unrealistic, but we get some numbers in the test verification.
But this latency time is with only 1 user, it's more important the scalability.
With more req/s, the latency scale very fast.
Plain php have a very low latency, but don't scale with fastcgi.

Symfony Fortunes test

Fastcgi:
image

Swoole using phpruntime:
image

Frankenphp using phpruntime:
image

Workerman using Adapterman:
image

@joanhey
Copy link

joanhey commented Nov 30, 2022

#php @symfony added @php_swoole and #frankenphp using the phpruntime to the TechEmpower benchmark.
In some days we'll have the numbers to compare vs @workermanphp using @adaptermanphp https://t.co/J5TgoiRPn5

— Adapterman (@adaptermanphp) November 30, 2022

@joanhey
Copy link

joanhey commented Dec 6, 2022

The initial tests are not too good for FrankenPHP.
But remember that is new, and need more work and optimizations.
These numbers will be better with time. And I'm in contact with dunglas, to help with any information.

Still not finished the run, also no results from Swoole and Workerman without a framework yet (in 2 days will finish the run).

Only platform runtimes without a framework, FrankenPHP without Worker mode:
image
Latency
image

In some hours we will have all Symfony runtimes using the same code, and will be a more fair comparison.

The link: https://www.techempower.com/benchmarks/#section=test&runid=124fd2af-3030-4315-8876-e1db1fa91193&test=fortune&l=xan9xb-35r&o=3&c=3

@joanhey
Copy link

joanhey commented Dec 7, 2022

The symfony results are ready:
image

So we'll show the json and single query:

Json
image

Latency
image

Single query
image
Latency
image

The link to visualize the results:
https://www.techempower.com/benchmarks/#section=test&runid=124fd2af-3030-4315-8876-e1db1fa91193&test=json&f=zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-v2qiv3-zik0zj-zik0zj-cn3

@joanhey
Copy link

joanhey commented Dec 7, 2022

This benchmark is the most fair, as all the runtimes use the same framework and code.

@javiereguiluz
Copy link
Member

Folks, we're closing this as "won't fix".

The reason is the same as explained here: #18432 (comment)

We prefer to keep this article focused on the changes/tweaks you can do in your Symfony app and in some very specific PHP ini settings to improve performance.

Using servers that provide async features is important for some apps, but those projects will need to document how to integrate them with Symfony apps. Thanks for understanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants