Flask's built in web server is meant for development, not production (see https://flask.palletsprojects.com/en/2.3.x/deploying/) so we need to install an additional library to make it work in production. A few past projects used gunicorn so let's go with that
There are some notes on configuration and design in this 🔒 slack thread. tldr; we may want to consider len(os.sched_getaffinity(0)) * 2 for number of workers, hardcode number of threads (e.g. 4), and have some sort of override/flag for the command in docker-compose to bypass gunicorn when running locally.
Flask's built in web server is meant for development, not production (see https://flask.palletsprojects.com/en/2.3.x/deploying/) so we need to install an additional library to make it work in production. A few past projects used gunicorn so let's go with that
There are some notes on configuration and design in this 🔒 slack thread. tldr; we may want to consider
len(os.sched_getaffinity(0)) * 2
for number of workers, hardcode number of threads (e.g.4
), and have some sort of override/flag for the command in docker-compose to bypass gunicorn when running locally.