Git Product home page Git Product logo

Comments (5)

schneems avatar schneems commented on August 12, 2024

If you kill the main process nothing will restart it. So it wouldn't really help, it would instead kill your app.

The main process doesn't serve requests and shouldn't grow in size. So this shouldn't be needed. If it was it would mean a memory leak in the puma  library.


Sent from Mailbox

On Wed, Dec 24, 2014 at 10:09 AM, Leooo [email protected] wrote:

Hello,
I may be missing someting totally obvious here, but:
This gem is great to mitigate memory leaks on applications using Puma. Though it only helps to restart workers, not to restart the main process when it is the one whose RAM is getting glutted.

Is this doable to restart the main process (and maybe all the workers at the same time then, not sure how it works) when this is the one consuming the most memory?

Reply to this email directly or view it on GitHub:
#10

from puma_worker_killer.

Leooo avatar Leooo commented on August 12, 2024

OK so I did miss something obvious then.

I agree this would be killing the whole app (which may still be needed sometimes), but I thought the main process was actually serving requests: number of processes running = (nb workers + 1). In my ActionController::Live controller I thought I saw requests were sometimes run by it, not by workers. And we can always run Puma with 0 workers, there is still a process running, and serving requests? But I must be wrong I will check more. Thanks for the quick answer.

from puma_worker_killer.

schneems avatar schneems commented on August 12, 2024

That +1 process you're seeing in puma the master process. When you have workers >=1 then the master process doesn't serve requests. Rather the master gets the request and then passes it to another worker to serve the request. It needs to be available to route the requests. Though it could be possible that i'm wrong and not understanding something but i'm pretty sure that's how it works cc/ @evanphx

from puma_worker_killer.

evanphx avatar evanphx commented on August 12, 2024

In cluster mode, the master process never runs requests.

from puma_worker_killer.

Leooo avatar Leooo commented on August 12, 2024

Thanks for the confirmation! My initial doubt came from the fact that I am checking which worker is running in my SSE thread using its index from the following line:

index=ObjectSpace.each_object(Puma::Cluster::Worker).map { |obj| obj }.first.try(:index)

but sometimes the index is empty, so I thought this may have been the master process.

L

from puma_worker_killer.

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.