[英]How to keep my web services awake in nodejs to run forever though i am using forever npm module?
I am using rabbitmq,mongodb and mysql with my webservices. 我在我的Web服务中使用Rabbitmq,mongodb和mysql。 To keep my webservices awake i am using npm forever module(forever start app.js). 为了使我的网络服务保持清醒,我正在使用npm forever模块(永远启动app.js)。
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info: Forever processing file: app.js
But my web services goes down after a certain period probably after 9-12 hours of started. 但是我的Web服务可能会在启动9到12个小时后一段时间后关闭。 If i restart my web services using node app or forever start app.js,my web services are again doing good and goes down again after certain span and this cycle goes on. 如果我使用节点应用程序重新启动我的Web服务或永远启动app.js,则我的Web服务再次运行良好,并且在经过一定时间后再次关闭,并且此循环继续进行。 Is there any possible way to fix this and also I would like to know the reason for this? 有什么办法可以解决这个问题,我也想知道原因吗?
Make sure you write the console log and error log to a file and check if you have any errors which is killing the node process. 确保将控制台日志和错误日志写入文件,并检查是否有任何错误会杀死节点进程。
forever start -o logs/out.log -e logs/err.log app.js
This might help troubleshoot exceptions and handle them. 这可能有助于排除异常并对其进行处理。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.