I have a FastAPI project deployed in Cloud Run using the hypercorn server. I’m using Uvloop as the event loop and leaving the other configurations with default values:
hypercorn app.main:app --bind 0.0.0.0:80 --worker-class uvloop
Here are the Cloud Run configurations:
- Memory: 1 GiB
- CPU: 1
- Maximum concurrent requests per instance: 80
- CPU is only allocated during request processing
- Minimum number of instances: 1
- Maximum number of instances: 30
- Startup CPU boost
- Use HTTP/2 end-to-end
When I get a peak of concurrent requests during integration testing, about 30, I usually get a 503, and then a new instance is started.
Any idea of why this happens?