Question

node.js keep stopping. No errors logged.

Hi all

I am running ubuntu and use a node.js to run a small website.

I am starting the server using forever with the following:

forever start -l forever.log -o out.log -e error.log server.js

It starts fine with some warning:

warn: --minUpTime not set. defaulting to 1000 warn: --spinSleepTime not set. Your script will exit if it does not stay up…

My experience with node is limited, so I not sure if these warning matter - they sound like they do.

The server will run fine with hardly any mem usage or load on the server.

It will last a few hours then just stop with nothing in the logs to indicate any problems.

Can anyone assist me, as I in despair on what it could be.?

Best wishes all

Johnny


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

When using forever, --spinSleepTime is important to set. One of the key features of forever is that it will respawn your process if it dies for one reason or another. This only works if that option is set. It refers to the time to wait between launches of a script that is considered “spinning.” It is in milliseconds. Using something like --spinSleepTime 10000 is usually a good default.