You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
This is related to #371 and potentially a duplicate/complementary information, feel free to close if it is deemed to be the case.
I was fooling around with different WSGI and ASGI servers while hacking on a web framework that would support both in the future.
As noted in #371, this is indeed a very inefficient scenario, however, what is worse, I found out the time required to turn around the request is at least O(n^2) or worse wrt the payload size.
POSTing some files and multipart forms with curl:
Payload size: 94171344
real 0m5.763s
user 0m0.033s
sys 0m0.012s
Payload size: 186054864
real 0m24.183s
user 0m0.018s
sys 0m0.061s
Payload size: 372178858
real 1m37.760s
user 0m0.044s
sys 0m0.152s
So it is not just inefficient loading everything into memory, but something else is going on.
Running uvicorn==0.11.5 as uvicorn --interface wsgi simple_reader:app.
The text was updated successfully, but these errors were encountered:
vytas7
changed the title
WSGI middleware: reading request body is worse than O(n^2) wrt payload size
WSGI interface: reading request body is worse than O(n^2) wrt payload size
Jun 30, 2020
vytas7
changed the title
WSGI interface: reading request body is worse than O(n^2) wrt payload size
WSGI interface: reading request body is O(n^2) wrt payload size
Jun 30, 2020
Hello!
This is related to #371 and potentially a duplicate/complementary information, feel free to close if it is deemed to be the case.
I was fooling around with different WSGI and ASGI servers while hacking on a web framework that would support both in the future.
As noted in #371, this is indeed a very inefficient scenario, however, what is worse, I found out the time required to turn around the request is at least O(n^2) or worse wrt the payload size.
POST
ing some files and multipart forms withcurl
:So it is not just inefficient loading everything into memory, but something else is going on.
Test case used:
Running
uvicorn==0.11.5
asuvicorn --interface wsgi simple_reader:app
.The text was updated successfully, but these errors were encountered: