-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Labels
Description
I created a API using fastapi. the API accepts a audio file and text , the audio and text are related to each other and also the text is used till the end of all operations in the API
async def create_file(upload_file:UploadFile = File(...),email: str = Form(...),text:str=Form(...)):
some operations
subprocess.popen(cmd)
stdout, stderr = process.communicate()
now when 2 users try to hit the API at the same time the request of 1st user is getting modified and the user 2 response is returned to both the users.
How can i solve this and also the API is on aws with 2 cores linux fedora os
I am using gunicorn to host it and to run it on two cores
gunicorn -w 2 --reload --bind 0.0.0.0:8080 --capture-output --error-logfile error_log.txt --access-logfile log.txt -k uvicorn.workers.UvicornWorker main:app
and is it possible to run 2 requests parallel y on two cores independently ?