-
-
Notifications
You must be signed in to change notification settings - Fork 414
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
Integration: Example with Slim app. #62
Comments
I knew that this error would cause some misunderstanding. 99% it's about wrong data in the buffer, and 1% is when the connection is corrupted on OS level. I guess I can make it less generic, something like Also, check https://github.com/spiral/roadrunner/wiki/PHP-Workers there is info about troubleshooting. Regarding Slim, is this the approach which will work for all Slim apps? If so I'm happy to add it into the wiki. |
I've used the provided example as a guide when integrating with more complicated Slim apps that involve a more in depth configuration for the slim container with many more routes defined etc. etc. Also, I thought i had linked to this page but i must have taken it out by accident... PSR7 With Slim .... So according to them it's designed to plug and play with any PSR7 implementation, so since all we're doing in this example is changing the built in slim psr7 request with one from our worker, it should work! Lastly, thanks for the PHP-Workers link. The issue was i, stupidly, forgot that |
@agentd00nut new error message has been added |
Regarding the integration, I would still like an independent verification just to be sure that I can add it to the Wiki. :) |
You can watch awesome-skeleton-roadrunner for an example (this is not Slim but the principles are similar). |
It's possible to reuse the same \Slip\App object by reseting Request and Response in the container. https://github.com/n1215/roadrunner-docker-skeleton/blob/slimphp/worker.php |
@wolfy-j, can you explain and help to improve solution / find bottleneck?
|
Few things:
My local bench results after the adjustments:
I'm not sure how to interpret these results, the rr shows much lower timings with much lower deviation, though the results in favor of nginx. The benchmark suite seems broken. Once I tried to bench containers using ab the results are very different (16 threads):
slim + nginx:
slim + roadrunner:
Also same bench running slim + nginx:
slim + roadrunner
|
Similar broken results for swoole: the-benchmarker/web-frameworks#1336 |
@wolfy-j @stdex I didn't know about https://roadrunner.dev/, but I'm working on a |
Yeah, something is really funky in the current state of this benchmark. |
This started as a request for help in understanding the
worker error: invalid prefix (checksum)
error but I finally managed to figure that it was caused by not running slim silently.Because that took me so long to realize I thought it might be helpful to show others an example.
If this should be a pull request i'll make one. Again it started as asking about the
invalid prefix
error.In addition: Would it be possible to make the
invalid prefix
error slightly less ambiguous? Searching forinvalid prefix
in the git doesn't lead to anything useful and changing it toworker error: invalid prefix (checksum) (make sure you aren't echoing before the worker responds to the server)
or some other more verbose message about what is going on could help people new to the project.The text was updated successfully, but these errors were encountered: