diff --git a/docs/deployment.md b/docs/deployment.md index 58927d95e..b0cac0b49 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -180,6 +180,14 @@ A process manager will handle the socket setup, start-up multiple server process Uvicorn provides a lightweight way to run multiple worker processes, for example `--workers 4`, but does not provide any process monitoring. +### Using cloud provider process manager + +Modern deployments often are deployed on a Softare as a Service platform or a Platform as a Service. +Examples include various offerings from AWS, GCP, Render, fly.io and Kubernetes (available as a service on many cloud providers). +These are just examples, Uvicorn does not necessarily recommend or endorse any of these above other options. +Kubernetes for example functions both as a process manager and load balancer. +These options can range form simple to complex, and they may not be better than other options listed below, but if you are already using Kubernetes or another option that offers load balancing and process maangement you do not need to also run your own process manager and load balancer. + ### Gunicorn Gunicorn is probably the simplest way to run and manage Uvicorn in a production setting. Uvicorn includes a gunicorn worker class that means you can get set up with very little configuration. @@ -192,7 +200,7 @@ The `UvicornWorker` implementation uses the `uvloop` and `httptools` implementat `gunicorn -w 4 -k uvicorn.workers.UvicornH11Worker` -Gunicorn provides a different set of configuration options to Uvicorn, so some options such as `--limit-concurrency` are not yet supported when running with Gunicorn. +Gunicorn provides a different set of configuration options to Uvicorn, so some options such as `--limit-concurrency` are not yet supported when running with Gunicorn. If you need to pass uvicorn's config arguments to gunicorn workers then you'll have to subclass `UvicornWorker`: diff --git a/docs/index.md b/docs/index.md index a129e7a52..d10935118 100644 --- a/docs/index.md +++ b/docs/index.md @@ -271,7 +271,7 @@ fully-featured process management. This allows you to increase or decrease the number of worker processes on the fly, restart worker processes gracefully, or perform server upgrades without downtime. -For production deployments we recommend using gunicorn with the uvicorn worker class. +If you need multiple workers process, for example if your CPU has multiple cores, you can run Uvicorn with Gunicorn workers as follows: ``` gunicorn example:app -w 4 -k uvicorn.workers.UvicornWorker