|
uvicorn run:app --workers 9 |
|
hypercorn run:app --workers 9 |
|
|
|
gunicorn run:app --workers=9 -k uvicorn.workers.UvicornWorker |
|
|
|
gunicorn run:app --workers=9 |
|
gunicorn run:app --workers=9 --worker-class=meinheld.gmeinheld.MeinheldWorker |
|
|
|
wrk --duration 20s --threads 10 --connections 200 http://localhost:8000/ping |
|
|
|
------------------------------ |
|
FastAPI + uvicorn |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 17.13ms 19.24ms 252.88ms 90.65% |
|
Req/Sec 1.54k 219.20 2.29k 69.35% |
|
307068 requests in 20.03s, 38.07MB read |
|
Socket errors: connect 0, read 85, write 0, timeout 0 |
|
Requests/sec: 15326.66 |
|
Transfer/sec: 1.90MB |
|
|
|
------------------------------ |
|
FastAPI + uvicorn - async |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 10.55ms 7.91ms 142.84ms 85.13% |
|
Req/Sec 2.06k 611.43 4.66k 63.60% |
|
410659 requests in 20.06s, 50.91MB read |
|
Requests/sec: 20473.65 |
|
Transfer/sec: 2.54MB |
|
|
|
------------------------------ |
|
FastAPI + hypercorn |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 25.37ms 18.92ms 130.41ms 78.14% |
|
Req/Sec 0.88k 342.42 1.91k 72.30% |
|
174472 requests in 20.03s, 22.30MB read |
|
Requests/sec: 8709.82 |
|
Transfer/sec: 1.11MB |
|
|
|
------------------------------ |
|
FastAPI + hypercorn - async |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 19.60ms 10.87ms 61.90ms 71.20% |
|
Req/Sec 1.05k 359.66 2.04k 60.55% |
|
209097 requests in 20.03s, 26.72MB read |
|
Requests/sec: 10436.90 |
|
Transfer/sec: 1.33MB |
|
|
|
------------------------------ |
|
FastAPI + gunicorn + uvicorn |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 26.29ms 24.72ms 171.82ms 86.06% |
|
Req/Sec 0.94k 484.69 2.06k 56.80% |
|
186557 requests in 20.09s, 23.13MB read |
|
Socket errors: connect 0, read 36, write 0, timeout 0 |
|
Requests/sec: 9283.99 |
|
Transfer/sec: 1.15MB |
|
|
|
------------------------------ |
|
FastAPI + gunicorn + uvicorn - async |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 19.25ms 14.96ms 122.48ms 77.98% |
|
Req/Sec 1.15k 291.98 2.04k 60.30% |
|
230221 requests in 20.04s, 28.54MB read |
|
Socket errors: connect 0, read 76, write 0, timeout 0 |
|
Requests/sec: 11485.82 |
|
Transfer/sec: 1.42MB |
|
|
|
------------------------------ |
|
Falcon + gunicorn |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 21.58ms 33.17ms 401.51ms 99.21% |
|
Req/Sec 572.84 260.23 1.08k 74.64% |
|
16279 requests in 20.04s, 2.41MB read |
|
Socket errors: connect 0, read 412, write 6, timeout 0 |
|
Requests/sec: 812.16 |
|
Transfer/sec: 122.93KB |
|
|
|
------------------------------ |
|
Falcon + gunicorn + meinheld |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 2.90ms 4.33ms 134.42ms 91.90% |
|
Req/Sec 9.20k 1.25k 15.58k 78.15% |
|
1838302 requests in 20.10s, 278.75MB read |
|
Socket errors: connect 0, read 39, write 0, timeout 0 |
|
Requests/sec: 91454.62 |
|
Transfer/sec: 13.87MB |
|
|
|
------------------------------ |
|
Falcon cython + gunicorn |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 23.35ms 47.76ms 523.73ms 98.46% |
|
Req/Sec 608.04 290.92 1.06k 69.66% |
|
16387 requests in 20.09s, 2.42MB read |
|
Socket errors: connect 0, read 357, write 4, timeout 0 |
|
Requests/sec: 815.64 |
|
Transfer/sec: 123.46KB |
|
|
|
------------------------------ |
|
Falcon cython + gunicorn + meinheld |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 2.67ms 3.67ms 128.47ms 90.44% |
|
Req/Sec 9.70k 1.38k 14.16k 66.70% |
|
1931630 requests in 20.01s, 292.90MB read |
|
Socket errors: connect 0, read 44, write 0, timeout 0 |
|
Requests/sec: 96540.80 |
|
Transfer/sec: 14.64MB |
|
|
|
------------------------------ |
|
Flask + gunicorn |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 23.87ms 25.11ms 314.30ms 99.21% |
|
Req/Sec 521.89 193.32 0.88k 76.62% |
|
16528 requests in 20.06s, 2.57MB read |
|
Socket errors: connect 0, read 341, write 5, timeout 0 |
|
Requests/sec: 823.77 |
|
Transfer/sec: 131.13KB |
|
|
|
------------------------------ |
|
Flask + gunicorn + meinheld |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 8.20ms 4.24ms 46.84ms 75.44% |
|
Req/Sec 2.49k 565.34 3.98k 77.55% |
|
495311 requests in 20.02s, 78.89MB read |
|
Socket errors: connect 0, read 46, write 0, timeout 0 |
|
Requests/sec: 24746.28 |
|
Transfer/sec: 3.94MB |
|
|
|
------------------------------ |
|
Flask + gunicorn + gevent |
|
-- |
|
Running 20s test @ http://localhost:8000/ping |
|
10 threads and 200 connections |
|
Thread Stats Avg Stdev Max +/- Stdev |
|
Latency 1.49ms 2.73ms 104.37ms 97.91% |
|
Req/Sec 1.31k 553.40 3.36k 60.99% |
|
134625 requests in 20.08s, 21.57MB read |
|
Socket errors: connect 0, read 0, write 0, timeout 23 |
|
Requests/sec: 6703.45 |
|
Transfer/sec: 1.07MB |
It would be supercool to re-run these benchmarks on Python 3.11 to see if its performance increases do anything for web frameworks.