How can I get warned when my server crashes for any reason? Does HopToad or any other service does that?
Thanks
EDIT:
I am using Heroku for node.js. Which doesn't allow me to run anything else. I need something to monit my code from inside out, without needing to run any other process.
Thanks
NET Core has an easier time working with CPU-intensive tasks and rendering static pages since the in-built IIS server kernel caching makes this process very straightforward. Therefore, . NET core vs node. js performance offers different advantages for various projects.
uptime() will return the time from where the server is started. Thus, you can run the URL like 192.168. 10.10:3000/status (or with public IP) to check if the server is running node or not.
You can try to handle uncaughtException event within your node.js program and do your "warn me" stuff there. Or you can use service like uptime robot to monitor if your app is listening on specified port for example.
Quite a few options actually!
monit, forever and supervisord are the ones that stick out of the crowd in my opinion.
Since @rob-cowie already answered about supervisor, here you get a few pointer about 'forever' and 'monit'.
Monit is an overall solution to manage services on your machine - notifying you and restarting them when they crash or take up too many resources.
I have yet to find a good reason to user supervisord instead of monit, but on supervisord mailing list I saw suggestions to use monit to monitor supervisord!
One approach is to periodically check that you can successfully access a page you are serving, see http://wasitup.com/.
Another approach would be to monitor the server process on your machine. One good way to do this is to launch node.js using Supervisord. It can restart a crashed process and email you. There are numerous examples around the intarwebs, including deployment example1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With