Replies: 5 comments
-
|
Can you elaborate on "when I download using Nginx, problem disappeared"? Are you directly downloading via nginx or nginx is setup as reverse proxy to FastAPI app? |
Beta Was this translation helpful? Give feedback.
-
@iudeen Sorry that I did not make a clear elaboration. When nginx is setup as reverse proxy to FastAPI app, the problem disappeared. You can check my docker reproduce step. I setup nginx as reverse proxy for fastapi app. Thank! |
Beta Was this translation helpful? Give feedback.
-
|
I tried your code without |
Beta Was this translation helpful? Give feedback.
-
|
Nginx would be the preferred method to stream content like videos, using features like X-Accel-Redirect (sometimes known as X-SendFile) if authentication is needed. Is there any reason why you would want to stream the video using FastAPI? |
Beta Was this translation helpful? Give feedback.
-
|
use Nginx support an url of video for frontend, donwload it by frontend, not backend api. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
HI when I downloaded video with fastapi StreamingResponse it will cause really high cpu usage after video be donwloaded completed! I already checked this issue but can not find any solution. However, when I download video behind the nginx, the problem disappered. Can someone help me fix this problem?
Reproduce step:
docker reporduce step:
Can someone help me fix this problem?
Operating System
Linux
Operating System Details
Same result on running with docker container
FastAPI Version
0.83.0
Python Version
3.8
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions