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

[PHP] Added DriftPHP as a Framework #3800

Merged
merged 2 commits into from
Jan 19, 2021
Merged

Conversation

mmoreram
Copy link
Contributor

No description provided.

@mmoreram
Copy link
Contributor Author

I have a question

  • This framework is based on a single-PHP-thread set of components named ReactPHP. Some other frameworks are actually using Nginx, which can work with several PHP threads at the same time, taking the maximum power of the server. Is there any rule here?

@mmoreram mmoreram force-pushed the master branch 4 times, most recently from b7bda7d to bc55f4b Compare January 18, 2021 10:13
@waghanza
Copy link
Collaborator

not for this, yet

this should be clarified on README

leocavalcante
leocavalcante previously approved these changes Jan 18, 2021
@leocavalcante
Copy link
Member

I have a question

  • This framework is based on a single-PHP-thread set of components named ReactPHP. Some other frameworks are actually using Nginx, which can work with several PHP threads at the same time, taking the maximum power of the server. Is there any rule here?

ReactPHP itself says you don't need threads, it is part of the runtime's architectural decision, if they say it could be efficient in a single-thread IMHO I don't see it as a competitive disadvantage to be solved by rules.
And actually, after #3786 with Swoole running with SWOOLE_BASE, it will run as a single-threaded server... also like other competitors like Node.js and Dart.

@mmoreram
Copy link
Contributor Author

@leocavalcante yes, ReactPHP is so efficient. I'm not talking in terms of absolute values, but in relative values (like Swoole, or NodeJS). Adding resources rules could be a nice addition, basically to provide all frameworks the same available resources (let's say 4 parallel CPUs, bringing the possibility to 1-single-thread servers to balance between these CPUs. Just an idea :)

Thanks for your work, BTW. Really cool project :)

@leocavalcante
Copy link
Member

Oh, I see. Yes, would be nice to have the used resources specified and ensured that all frameworks are running under the same conditions and then what the framework does with the resources is about it's features.

Ps.: Not sure if you are thanking me for this project or you forgot to mention @waghanza, but to clarify, he is the one putting way more efforts, I'm just new here.

@mmoreram
Copy link
Contributor Author

mmoreram commented Jan 18, 2021

@leocavalcante Oh, I saw that you approved this PR, so I thought that. Sorry cc/ @waghanza

BTW, about your reference, and after reviewing the documentation, and not being 100% sure about this, Swoole works as a PHP extension, having a configuration called reactor_num / worker_num. The same extension allows you to work with this CPU concurrency. (if you have some extra info about this, I would be very interested in knowing a bit more)

@leocavalcante
Copy link
Member

@mmoreram unfortunately, the english version of Swoole's documentation isn't complete as the Chinese wiki, but Google Translator can help: https://translate.google.com/translate?sl=auto&tl=en&u=https://wiki.swoole.com/wiki/page/353.html
There is also this issue: swoole/swoole-src#1085 simple, but says exactly that.

@waghanza
Copy link
Collaborator

waghanza commented Jan 18, 2021

About resources : when using cloud resources (planned but have to be written in the roadmap) any framework will be set-up in an isolate VM (of course same VMs for all), it up-to the code to spread on all CPU units

@mmoreram
Copy link
Contributor Author

mmoreram commented Jan 18, 2021

@waghanza when you mean the code, you mean the same framework, right? I mean, if DriftPHP relies in the final user balancing desire (like AWS balancing between N docker containers) instead of internal framework balancing, could I add an external layer of balancing?

@waghanza
Copy link
Collaborator

@mmoreram Short answer, no. Long answer, perhaps.

As you know, infrastructure has a cost. The first step is to spot one VM per framework, depending on that we can plan any feature like that

@mmoreram
Copy link
Contributor Author

@waghanza I think that I explained wrong. When I talk about external balancing, I mean that the entrypoint of the framework is a balancer among X (let's say 4) instances of the framework. I you understood that, then OK with that answer :)

@waghanza
Copy link
Collaborator

I had understood before, but probably mis-explained 😛 there will not be external load load balancing. What's the framework is doing inside (balance between threads or reuse_port) is out of this project scope

@mmoreram
Copy link
Contributor Author

Good :) Thanks!

@waghanza waghanza self-requested a review January 18, 2021 16:11
php/driftphp/composer.json Show resolved Hide resolved
php/driftphp/composer.json Outdated Show resolved Hide resolved
php/driftphp/composer.json Outdated Show resolved Hide resolved
php/driftphp/composer.json Outdated Show resolved Hide resolved
php/driftphp/config.yaml Outdated Show resolved Hide resolved
php/driftphp/config.yaml Outdated Show resolved Hide resolved
php/driftphp/Drift/config/routes.yml Outdated Show resolved Hide resolved
@mmoreram mmoreram force-pushed the master branch 2 times, most recently from 196bc59 to e3d37b3 Compare January 19, 2021 10:27
@waghanza waghanza merged commit a99376e into the-benchmarker:master Jan 19, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants