Git Product home page Git Product logo

Comments (2)

canoeberry avatar canoeberry commented on August 12, 2024

I am trying out puma worker killer and must be misunderstanding it.

I am running in a docker container with 16 Gb RAM and 48 workers. The system thinks 20Gb of ram is being used, but it's largely shared because puma preloads and then forks and it's all shared memory. 'top' reports only 19% of the RAM in use.

However, as requests are made to the rails app, the total size reported by PWK remains largely the same, within a GB, whereas the "top" app shows actual system memory going up and up until puma instances exit rather suddenly due to low memory. That would be fine with me except the main puma thread doesn't seem to notice that the process died in time to prevent it from being handed out to another request. Either that or it's actually dying in the middle of a request, which i suppose is more likely. Either way, clients get errors and that's unacceptable.

So, how can I configure PMK? The initial memory used according to top is 19%, the the memory size used according to PWK is 20Gb. When top hits 95%, PMK thinks it's maybe 21Gb.

So - the problem is that you cannot accurately and efficiently calculate the amount of RAM a process is using all on its own, right? The VmRSS from linux includes shared data. As that shared data slowly transforms into unshared data, there's no outward appearance changes.

[Now I've written this, I am not sure my point, but since I accidentally created this issue, I feel I should at least explain myself.]

from puma_worker_killer.

schneems avatar schneems commented on August 12, 2024

From inside of a container you need to use the "rolling restarts" feature as containers do not expose the "correct" amount of memory being used details are here https://github.com/zombocom/puma_worker_killer?tab=readme-ov-file#turn-on-rolling-restarts---heroku-mode.

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.