# Server Workers - Uvicorn with Workers Let's check back those deployment concepts from before: * Security - HTTPS * Running on startup * Restarts * **Replication (the number of processes running)** * Memory * Previous steps before starting Up to this point, with all the tutorials in the docs, you have probably been running a **server program**, for example, using the `fastapi` command, that runs Uvicorn, running a **single process**. When deploying applications you will probably want to have some **replication of processes** to take advantage of **multiple cores** and to be able to handle more requests. As you saw in the previous chapter about [Deployment Concepts](concepts.md){.internal-link target=_blank}, there are multiple strategies you can use. Here I'll show you how to use **Uvicorn** with **worker processes** using the `fastapi` command or the `uvicorn` command directly. /// info If you are using containers, for example with Docker or Kubernetes, I'll tell you more about that in the next chapter: [FastAPI in Containers - Docker](docker.md){.internal-link target=_blank}. In particular, when running on **Kubernetes** you will probably **not** want to use workers and instead run **a single Uvicorn process per container**, but I'll tell you about it later in that chapter. /// ## Multiple Workers You can start multiple workers with the `--workers` command line option: //// tab | `fastapi` If you use the `fastapi` command:
fastapi run --workers 4 main.py INFO Using path main.py INFO Resolved absolute path /home/user/code/awesomeapp/main.py INFO Searching for package file structure from directories with __init__.py files INFO Importing from /home/user/code/awesomeapp ╭─ Python module file ─╮ │ │ │ 🐍 main.py │ │ │ ╰──────────────────────╯ INFO Importing module main INFO Found importable FastAPI app ╭─ Importable FastAPI app ─╮ │ │ │ from main import app │ │ │ ╰──────────────────────────╯ INFO Using import string main:app ╭─────────── FastAPI CLI - Production mode ───────────╮ │ │ │ Serving at: http://0.0.0.0:8000 │ │ │ │ API docs: http://0.0.0.0:8000/docs │ │ │ │ Running in production mode, for development use: │ │ │ │ fastapi dev │ │ │ ╰─────────────────────────────────────────────────────╯ INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) INFO: Started parent process [27365] INFO: Started server process [27368] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Started server process [27369] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Started server process [27370] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Started server process [27367] INFO: Waiting for application startup. INFO: Application startup complete.```