I am using a simple demo Starlette app (right out of the docs, just added an asyncio.sleep()
statement there:
import asyncio
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route
async def homepage(request):
await asyncio.sleep(1)
return JSONResponse({'hello': 'world'})
app = Starlette(debug=True, routes=[
Route('/', homepage),
])
I am running this using uvicorn
Using a load testing client (e.g. locust, or a custom test client), I see that I get 1 response per second, which implies no parallelism.
Shouldn't Starlette serve multiple requests concurrently?