MCBoarder289 / shelf-help

Shelf Help - an app to help connect your Goodreads shelf with your library
https://shelfhelpapp.com
MIT License
4 stars 0 forks source link

Productionize Gunicorn config #35

Open MCBoarder289 opened 6 months ago

MCBoarder289 commented 6 months ago

Repurposing this issue for all things Infrastructure related. Not just gunicorn config, but BE infrastructure.

In order to handle load properly, need to properly update the gunicorn command to something like:

gunicorn --workers=3 app:app -t 60 --keep-alive 60

Workers by default should be: (2*CPU)+1 , so 3 for a single cpu.

Helpful Medium Post Helpful Stack Overflow #1 Helpful Stack Overflow #2

Assumptions

MCBoarder289 commented 6 months ago

What happens when all workers are busy? Helpful post on gunicorn's github

MCBoarder289 commented 2 months ago

Using different worker types. Might be interesting because I am primarily I/O bound with all of the network calls: https://dev.to/lsena/gunicorn-worker-types-how-to-choose-the-right-one-4n2c

EDIT: Chose to go with gevent workers because of the network I/O calls

MCBoarder289 commented 2 months ago

Oracle has a substantial free tier to when it comes to computing power. Here's an article on how to deploy a python service: https://docs.oracle.com/en-us/iaas/developer-tutorials/tutorials/flask-on-ubuntu/01oci-ubuntu-flask-summary.htm