Skip to content

STAC API and Tiler not using gunicorn worker and worker configuration #138

@tonybaloney

Description

@tonybaloney

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions