-
Notifications
You must be signed in to change notification settings - Fork 31
Description
I just noticed that the Tiler API and STAC APIs are launching uvicorn directly to start FastAPI and not using gunicorn with a server worker.
This is fine for development, but for a production FastAPI instance it would create a queueing bottleneck for concurrent requests.
Secondly, there is no default worker processes and/or thread configuration for GUnicorn configured. This would significantly improvement throughput of the application (like a 4x improvement in requests/sec).
See https://www.uvicorn.org/deployment/#using-a-process-manager and https://fastapi.tiangolo.com/deployment/server-workers/
Spotted this in these places:
https://github.com/microsoft/planetary-computer-apis/blob/main/pctiler/Dockerfile#L47
https://github.com/microsoft/planetary-computer-apis/blob/main/pcstac/Dockerfile#L17
https://github.com/microsoft/planetary-computer-apis/blob/main/docker-compose.yml#L19
https://github.com/microsoft/planetary-computer-apis/blob/main/docker-compose.yml#L38
Happy to submit a PR with benchmark, unless I'm missing something