Gurus of SO
I am running Node.js as a daemon using monit & it turns out that it fails every 60 seconds on the dot. Here's my monit.log
root@mybox:/etc/monit# tail -f /var/log/monit.log
[UTC Sep 4 12:07:50] info : 'nodejs' start: /sbin/start
[UTC Sep 4 12:08:50] error : 'nodejs' failed, cannot open a connection to INET[127.0.0.1:8000] via TCP
[UTC Sep 4 12:08:50] info : 'nodejs' trying to restart
[UTC Sep 4 12:08:50] info : 'nodejs' stop: /sbin/stop
[UTC Sep 4 12:08:50] info : 'nodejs' start: /sbin/start
[UTC Sep 4 12:09:50] error : 'nodejs' failed, cannot open a connection to INET[127.0.0.1:8000] via TCP
[UTC Sep 4 12:09:50] info : 'nodejs' trying to restart
[UTC Sep 4 12:09:50] info : 'nodejs' stop: /sbin/stop
[UTC Sep 4 12:09:50] info : 'nodejs' start: /sbin/start
[UTC Sep 4 12:10:50] info : 'nodejs' connection succeeded to INET[127.0.0.1:8000] via TCP
Here's my monit config from monitrc
set logfile /var/log/monit.log
check host nodejs with address 127.0.0.1
start program = "/sbin/start nodeapp"
stop program = "/sbin/stop nodeapp"
if failed port 8000 protocol HTTP
request /
with timeout 10 seconds
then restart
Am I doing something wrong in this configuration or is there some other reason Node seems to fail so regularly? Where else should I look to pinpoint this problem?
Thank you.