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

[Swoole] Support large streamed response #636

Closed
alecpl opened this issue Feb 1, 2023 · 3 comments
Closed

[Swoole] Support large streamed response #636

alecpl opened this issue Feb 1, 2023 · 3 comments

Comments

@alecpl
Copy link

alecpl commented Feb 1, 2023

I've seen #109 that discusses and fixes StreamedResponse support. However, this does not work for very large output (in gigabytes) because it's buffered in SwooleClient::endResponseContent().

A solution would be to use something like in https://gist.github.com/27pchrisl/6dbe0993b2423531b4afaf406a05224d

Would any of this be acceptable for Octane 1.x?

Please, do not just close the ticket, I'm willing to work on this, but any help would be appreciated.

@alecpl
Copy link
Author

alecpl commented Feb 1, 2023

I'm clueless, maybe this is not the buffering/memory issue. I noticed it fails at around 30 seconds, so I increased the Octane's and Swoole's execution limits. It does not reach the limit anymore, but the worker fails:

[2023-02-01 13:29:04 $21932.0]<>WARNING>Server::check_worker_exit_status(): worker(pid=21942, id=1) abnormal exit, status=0, signal=9

Note, I have no problem with streaming small data. And I modified the Octane's code to completely omit the code path with ob_start().

@nunomaduro
Copy link
Member

Are you using Laravel's stream responses? If so, please submit a pull request with the required modifications in Octane, including a failing test that would be resolved by your new code.

I will be closing this issue, but don't worry! I will follow up and assist you with the pull request. ❤️

@alecpl
Copy link
Author

alecpl commented Feb 16, 2023

FYI, it looks like it was a memory leak in Swoole swoole/swoole-src#4974

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

2 participants