You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
In particular, when running on Kubernetes you will probably not want to use Gunicorn and instead run a single Uvicorn process per container, but I'll tell you about it later in that chapter.
I think for Stac API we could relaxe this but for the tiler maybe not because it's really CPU intensive (and not really async)
Thanks @tonybaloney - we've been considering reverting back to GUnicorn for our STAC API to evaluate the impact on some behaviors we've been seeing with requests. In general, concurrency potential of those requests should be high. We'll want to do some benchmarking, but we appreciate the observations.
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
The text was updated successfully, but these errors were encountered: