Coder Social home page Coder Social logo

Comments (5)

gi0baro avatar gi0baro commented on August 28, 2024 3

This will require quite an effort, as the main process – which right now is quite simple – should behave like a real arbiter and effectively manage child process continuously.

Probably I can take a look at what gunicorn does, but this for sure will require some time.

from granian.

snuderl avatar snuderl commented on August 28, 2024 1

Similar/related thing is having a request timeout after which to kill a process if it did not respond

https://docs.gunicorn.org/en/stable/settings.html#timeout

from granian.

gi0baro avatar gi0baro commented on August 28, 2024 1

I'm not sure Granian should handle all of this complexities.
If the aim would be having 1:1 feature comparison with Gunicorn, probably it would make more sense to implement Granian workers for Gunicorn..

from granian.

cirospaciari avatar cirospaciari commented on August 28, 2024 1

I'm not sure Granian should handle all of this complexities. If the aim would be having 1:1 feature comparison with Gunicorn, probably it would make more sense to implement Granian workers for Gunicorn..

timeouts, and backpressure (max req) sound like features for Emmett, not for Granian.

from granian.

sidmitra avatar sidmitra commented on August 28, 2024

probably it would make more sense to implement Granian workers for Gunicorn..

This also makes sense, but i'm not aware of the tradeoffs.

I created the ticket thinking of the feature that has made me choose gunicorn over others like Daphne even. In any reasonably complex web app(like enterprise!) memory leaks seem to be a big issue and hence this seemed like an must-have. This is obviously not true for every project, and perhaps Granian works perfectly fine for other use cases.
It might be possible to keep the design open in a way that these can be implemented by the community perhaps in the future if needed.


Further stream of thought

As @snuderl pointed out, request timeout is a thing also because as the team grows devs tend to add all kinds of things like network requests without timeout. At that point stray endpoints making these requests will just hang! and hence you're forced to want a timeout or hunt down each network request and hack/patch your way sometimes to add a timeout.

At work(team of ~100 devs) these are the flags that keep the app running smoothly without too many problems.

--timeout=28 --workers=X --max-requests=250 --max-requests-jitter=10

The timeout of 28 seconds is just to keep it lower than 30(which was the Heroku hard limit), so we can receive Python traceback errors. The initial idea was to progressively lower it and force all endpoints to "improve" performance over time till reaching a sane value.

from granian.

Related Issues (20)

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.