Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

Switch to uvicorn in production #24

Open
ChrisLovering opened this issue Oct 27, 2021 · 3 comments
Open

Switch to uvicorn in production #24

ChrisLovering opened this issue Oct 27, 2021 · 3 comments

Comments

@ChrisLovering
Copy link
Member

Since we use kubernetes in production, we should handle replication at the cluster level instead of using a process manager (like Gunicorn with workers) in each container.

See: https://fastapi.tiangolo.com/deployment/docker/#when-to-use

@jchristgit
Copy link
Member

I'm 50/50 on this. A completely separately container here will be a lot heavier
to scale up and down than simply using multiple workers in a single container.

@ChrisLovering
Copy link
Member Author

Yea I think it's a trade off between better multi-core support and better load balancing.

Do you know off the top of your head what the load difference would be? The reason I ask it afaik gunicorn has a management process on top of each of the worker processes, which wouldn't be needed with individual containers. So we do drop one of the resource sinks by doing this.

@ChrisLovering
Copy link
Member Author

cc @python-discord/devops

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants