Please note:
A more fair comparison is here with gunicorn using the meinheld worker https://gist.github.com/erm/975e9a8dda60d94823dc5f8a8d354b57.
Also, these benchmarks were run against an experimental fork of Django and the testing conditions are not ideal. They aren't intended to be a conclusive measure of the performance differences between ASGI/WSGI. Proper benchmarks to come later.
Test project:
https://github.com/erm/django-async-tests
uvicorn (ASGI)
Running: uvicorn asgiproj.asgi:application -b 127.0.0.1:8001
[erm@fezzan ~]$ wrk -d20s -t10 -c200 http://127.0.0.1:8001/asgi/
Running 20s test @ http://127.0.0.1:8001/asgi/
10 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 28.68ms 10.16ms 69.46ms 76.20%
Req/Sec 700.81 130.10 4.79k 82.43%
139697 requests in 20.10s, 19.32MB read
Socket errors: connect 0, read 78, write 0, timeout 0
Requests/sec: 6949.09
Transfer/sec: 0.96MB
gunicorn (WSGI)
Running: gunicorn asgiproj.wsgi:application -b 127.0.0.1:8001
[erm@fezzan ~]$ wrk -d20s -t10 -c200 http://127.0.0.1:8001/wsgi/
Running 20s test @ http://127.0.0.1:8001/wsgi/
10 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 115.78ms 9.45ms 170.10ms 87.99%
Req/Sec 109.18 27.44 190.00 67.76%
16432 requests in 20.10s, 2.98MB read
Socket errors: connect 91, read 1145, write 22, timeout 0
Requests/sec: 817.51
Transfer/sec: 151.69KB
This comment has been minimized.
ChillarAnand commentedJun 18, 2018
•
edited
These views hello world views. It is interesting to note that asgi is 8x faster than wsgi. Need to see how this works on actual crud apps with db calls.