GithubHelp home page GithubHelp logo

Comments (6)

dandv avatar dandv commented on August 23, 2024 3

Would love to see this feature. Right now we're using pm2, which does display memory usage.

pm2 screenshot

from forever.

markstos avatar markstos commented on August 23, 2024 2

As a current forever user, I'm looking at switching to using systemd as a process supervisor to address this in the need in the future.

First, if you are already on a system that has systemd running, it's one less dependency. systemd will be default on a Ubuntu LTS release in a just a few months.

Second, systemd can supervise processes for users, not just for root, if you have that need.

Third, to address the memory use question here, systemd supports "cgroups" which allow to specify memory limits for your app (as well as CPU limits and blkio limits).

systemd has other benefits as well that apply to Node such as "socket activated processes". Your Node.js app can be off until a request comes in on port 80, at which point it's spun up. With a couple more lines of Node.js code, you could even have your server shutdown if there are no requests in X minutes. (until the next request comes in). That would be another way to reclaim memory when the server is idle. This is an appealing feature for cases like a developer server that might have lots of Node processes running that are infrequently used or for a rarely-used backend service with a memory leak.

Finally, if you are managing Linux servers based on systemd, you are going to have to learn it support it anyway. If the OS already has a good at process manager, why add another layer to do it?

Some resources:

from forever.

ded avatar ded commented on August 23, 2024

+1 that would be rad. tho paired with a notification system would go perfect with this so that you'd know that you actually have a memory problem (otherwise i'd probably never bother to debug if it was always magic all the time)

from forever.

indexzero avatar indexzero commented on August 23, 2024

This has been possible via custom forever hooks since [email protected]. A pull-request exposing CLI options would be welcome

from forever.

seiyria avatar seiyria commented on August 23, 2024

Just wanted to chime in and say this would be nice.

from forever.

t3chguy avatar t3chguy commented on August 23, 2024

👍

from forever.

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.