Git Product home page Git Product logo

Comments (4)

H3zi avatar H3zi commented on June 15, 2024 1

@anthonycorletti I had the time to rethink this and I concluded that gunicorn is still a good choice for CloudRun after all (and other systems as well), as long as the user has the option to deploy on CloudRun with multiple CPUs (and he is not utilizing them for multi-process work inside the server), gunicorn can have a great impact on performance.
So I guess the number of workers really depends on the number of CPUs the revision deployed with.

from cloudrun-fastapi.

anthonycorletti avatar anthonycorletti commented on June 15, 2024

great question! sebastian makes a great point and i would suggest deploying your container in the best way that suits your use case. for something like cloud run i think the approach of using a single uvicorn worker is fine. you could also just run one gunicorn-uvicorn worker. there is no particularly rigorous reason why ive done it this way. ive been using fastapi for a few years now so i might be a bit stuck in my ways haha. ill see if i have time to make some changes. open to pull requests if you'd like to make one for uvicorn deployment support!

from cloudrun-fastapi.

anthonycorletti avatar anthonycorletti commented on June 15, 2024

@H3zi lmk what you think of https://github.com/anthonycorletti/cloudrun-fastapi/tree/docker/single-uvicorn-worker-per-container/ hope it helps!

The more I think about it I definitely think it depends on your applications. If you don't want to rely on thread management directly through fastapi alone, gunicorn+uvicorn would be good to use.

from cloudrun-fastapi.

anthonycorletti avatar anthonycorletti commented on June 15, 2024

sounds cool! ill close this out.

from cloudrun-fastapi.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.