Performance: Accepting connections
MEDIUM IMPACT
This affects how quickly the server can start handling incoming user requests, impacting initial response time and throughput.
import uvicorn if __name__ == "__main__": uvicorn.run("app:app", host="0.0.0.0", port=8000, workers=4, loop="uvloop")
import uvicorn if __name__ == "__main__": uvicorn.run("app:app", host="0.0.0.0", port=8000, workers=1, loop="asyncio")
| Pattern | Concurrent Connections | Request Queue | Response Start Delay | Verdict |
|---|---|---|---|---|
| Single worker, default loop | Low | High under load | High delay | [X] Bad |
| Multiple workers, uvloop | High | Low | Low delay | [OK] Good |