Preliminary Performance

Tests performed using ali.

Methodology

Request with 4 byte payload, and common ASGI app executing the following:


async def app(scope, receive, send):
    await receive() # added: receive the full payload
    await send({
        'type': 'http.response.start',
        'status': 200,
        'headers': [
            (b'content-type', b'text/plain'),
        ],
    }) # send a start callback
    await send({
        'type': 'http.response.body',
        'body': b'Hello, world!',
    }) # send a body

modified from uvicorn docs

Execution

50 req / s

ali http://127.0.0.1:8000 -b body --rate=50

500 req / s

ali http://127.0.0.1:8000 -b body --rate=500

1000 req / s

ali http://127.0.0.1:8000 -b body --rate=1000

5000 req / s

ali http://127.0.0.1:8000 -b body --rate=5000

Commands

uvicorn

uvicorn dotest.baz:app

hypercorn

hypercorn dotest.baz:app

spvn

spvn serve --target dotest.baz:app

Results

hypercorn-50 hypercorn @ 50 reqs/s

hypercorn-500 hypercorn @ 500 reqs/s

hypercorn-1000 hypercorn @ 1000 reqs/s

hypercorn-5000 hypercorn @ 5000 reqs/s (crash / ddos thresh)

uvicorn-50 uvicorn @ 50 reqs/s

uvicorn-500 uvicorn @ 500 reqs/s

uvicorn-1000 uvicorn @ 1000 reqs/s

uvicorn-5000 uvicorn @ 5000 reqs/s (crash / ddos thresh)

spvn-50 spvn @ 50 reqs/s

spvn-500 spvn @ 500 reqs/s

spvn-1000 spvn @ 1000 reqs/s

spvn-5000 spvn @ 5000 reqs/s

spvn-10000 spvn @ 10000 reqs/s (dropped requests but continued service <130ms P95)

POST Test

Source: https://github.com/serde-rs/json-benchmark/blob/master/data/canada.json