-
-
Notifications
You must be signed in to change notification settings - Fork 175
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 streaming backpressure #152
Comments
Doesn't look like a problem for Quart, the ASGI app. The ASGI separates ASGI server and ASGI app. All the ASGI app gets is In my understanding, "adding streaming backpressue" means calling From what I've read, In In ASGI servers like
The backpressure thing sounds like an ASGI server thing. |
It is both. At the moment there is no way for the app to place back pressure on the server. In the ASGI setup this could be done, for example, by not awaiting receive whilst the app catches up. |
Is this about streaming uploads? I'm seeing 413 errors due to hitting
But this is not working, and it's clear that Body.append() is sync and simply appends to the buffer and then fails with HTTP 413 if The backpressure would need to be applied here at the ASGI layer such that if the request body buffer is not draining then we don't accept a new ASGI message on this connection. |
I've encountered this problem too. The root of it is that Ideally, (This would involve the |
Some more context when this is relevant.
In this configuration, the Quart app acts as a proxy. As the httpx client is slowly consuming data because of the network speed, Quart buffers incoming data which is being uploaded at a very high speed because of a localhost connection. For huge payloads, this results in either memory allocation errors, or the out-of-memory killer killing the app.
^ From @andrewsh
The text was updated successfully, but these errors were encountered: