Skip to content

Add new swoole variation: swoole behind nginx #3889

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

Closed
simonhf opened this issue Jun 26, 2018 · 3 comments
Closed

Add new swoole variation: swoole behind nginx #3889

simonhf opened this issue Jun 26, 2018 · 3 comments

Comments

@simonhf
Copy link

simonhf commented Jun 26, 2018

I went to this page [1] as suggested but could not figure out how to comment on the page to suggest a new framework. So I'm opening an issue here to use as the suggestion.

My suggestion is to make a variation of the existing swoole benchmark. This line [2] tells swoole to use all available cores for its workers. However, in my own tests I have found that if I have e.g. an n CPU box and start n swoole instances with each 1 worker listening on its own unique port, and then put an nginx load balancer infront of it, then with this configuration I have been able to achieve up to 24% more TPS. I think this is because swoole does some things really well and other things not so well, like managing requests between its workers.

If you added this variation of swoole behind nginx then for some tests swoole might be in the #2 spot, barking directly on the heels of vert-x :-)

HTH,
Simon

[1] https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Suggested-Frameworks,-Languages-and-Features
[2] https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/PHP/swoole/swoole-server.php#L8

@NateBrady23
Copy link
Member

ping @Wulfklaue

@Wulfklaue
Copy link
Contributor

Ping @twose


Hi @simonhf

If you think it works better, give it a shot. That is the nice thing about the TechEmpowered benchmark. It allows for testing frameworks under extreme loads that can differ from small personal tests.

You can copy the Swoole test code here and make a Swoole 2 test with your changes. The current Swoole test will not get any updates until matyhtf has officially solved the plain-text test issue. And he is too busy with Swoole 4.0 and the new Coroutine system.

If your solution works better, i will push any changes and updates to your version in the future and ask for the old version to be removed.

If you added this variation of swoole behind nginx then for some tests swoole might be in the #2 spot, barking directly on the heels of vert-x :-)

I am fairly sure that Swoole with proper PosggreSQL drivers will be able to hit Nr 1 spot in a lot of benchmarks ( its already number one for MySQL in several ). But the driver is unfortunately only half implemented ( missing stuff like prepare statements etc ).

@simonhf
Copy link
Author

simonhf commented Jun 26, 2018

Hi @Wulfklaue, Thanks for the encouragement. I'm willing to try it, but how do I get access to the test environment and boxes etc? Are there instructions for adding components like nginx to a test? Thanks, Simon

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