[Python] Gunicorn으로 실행시키기


[Python] Gunicorn으로 실행시키기

명령어 패키지 설치 sudo apt install -y gunicorn pip install gunicorn Gunicorn 실행 # 워커를 4개로 실행시키고 서버에서 처리지연이 있는 경우에는 타임아웃을 길게 잡아야 워커가 중간에 타임아웃되어 멈추지 않는다. gunicorn -k uvicorn.workers.UvicornWorker --access-logfile ./gunicorn-access.log main:app --bind 0.0.0.0:8001 --workers 4 --timeout 3600 # 백그라운드에서 돌릴경우에는 뒤에 옵션 "--daemon"을 추가로 넣어주면 된다. EX) gunicorn -k uvicorn.workers.UvicornWorker --access-logfile ./gunicorn-access.log src.main:app --bind 0.0.0.0:8001 --workers 4 --timeout 3600 --daemon 파이썬 3.10 실행방법 # ...


#daemon #gunicorn #python #timeout #worker #파이썬

원문링크 : [Python] Gunicorn으로 실행시키기