Menu

Post image 1
Post image 2
1 / 2
0

Uvicorn: The Lightning-Fast ASGI Server Powering Modern Python Apps

DEV Community·MEROLINE LIZLENT·20 days ago
#6nfUxu1z
Reading 0:00
15s threshold

If you have ever used FastAPI or Starlette, you've already heard of Uvicorn, as it is the server that runs your app. However the majority of tutorials only discuss it as a side effect of one-liner. In this article, we'll dive deep – into the internals of Uvicorn, into correct configuration of Uvicorn and into deployment of Uvicorn in production the right way. What Is Uvicorn? Uvicorn is an ASGI (Asynchronous Server Gateway Interface) server implementation for Python, based on uvloop and httptools. It's designed specifically for running async Python web frameworks like FastAPI, Starlette, Django Channels, and Quart. Why WSGI vs ASGI? The classic server interface used in python is WSGI (which is used in Flask and Django). It's a synchronous request, one by one per worker. It is good for conventional applications and doesn't work well with: WebSockets Long-polling Async database calls High-concurrency workloads ASGI solves this. Uvicorn is the fastest server implementation for it, its the async version of WSGI.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More