All posts

Which is the fastest ASGI server?

ASGI is a specification which allows interoperability of async Python web frameworks and servers. There are several different ASGI servers (Daphne, Hypercorn, Uvicorn).

I was recently doing some load testing for a website, which has to support large numbers of visitors concurrently. I didn't expect there to be any dramatic differences in performance between the different ASGI servers, but even if there's a 20% difference, I'll take it.

It's also a good opportunity to show off Locust, which is a nice load testing tool.

The testing process and results are documented on GitHub.

Results

Uvicorn:

Hypercorn:

Daphne:

Conclusions

Uvicorn achieved roughly 40% more throughput than the others in this test. However, they all did well, and were stable under high load.

Posted on: 28 Feb 2021

Have any comments or feedback on this post? Chat with us on GitHub.

Allow Google Analytics?

This helps us improve the website. You can change your preference at any time.