If you have a simple FastAPI application you use
uvicorn main:app --reload --port 4681 --host 0.0.0.0
with the following main.py
Simple demo app looks like this:
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
return {"item_id": item_id, "q": q}
and it may show the following information
INFO: Started server process [18983]
INFO: Waiting for application startup.
INFO: Uvicorn running on http://0.0.0.0:4681 (Press CTRL+C to quit)
I use ps -o nlwp 18983
to see how many threads this process (18983) is using.