Using gunicorn for production, some things to fix
First thing first, here’s the correct command line to use gunicorn:
./venv/bin/gunicorn "argos.server.main:get_application()" -w 4 -k uvicorn.workers.UvicornWorker
(See https://github.com/encode/uvicorn/discussions/1810 for the explanation of "argos.server.main:get_application()"
instead of argos.server.main:get_application
)
The problem of using gunicorn is that it will use the read_config_and_populate_db
fonction for each worker, I think it may become a problem one day. We may use a lockfile, don’t you think, @almet?
-
fix command line in doc -
avoid using read_config_and_populate_db
for each worker
Edited by Luc Didry