简体   繁体   English

即使我使用的是永久性的npm模块,如何使我的web服务在nodejs中保持永久性运行?

[英]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.

相关问题 如何将 $_POST 变量设置为永远保存在 $_SESSION 中? - How can I set my $_POST variables to be saved in $_SESSION forever? 如何在nodejs中循环查询mysql? 因为你应该等到查询结果可用否则循环将永远运行 - How to query mysql in nodejs in a loop? because you should wait until result of query is available else loop will run forever 我如何有效地运行一个不会在 wamp 环境中永远执行的 PHP 脚本......? - How do I efficiently run a PHP script that doesn't take forever to execute in wamp enviornemnt...? 为什么此MySQL查询需要永远运行? - Why does this MySQL query take forever to run? 我正在尝试从mysql数据库中获取发布数据。 但是循环永远运行。 为什么? - I am trying to fetch post data from mysql database. But the loop is running forever. Why? mysql内部连接需要永远运行 - mysql inner join with takes forever to run MySQL查询要永远运行,这是怎么回事? - MySQL query taking forever to run, what is wrong? 为什么我的mysql查询获取“最多”数据只是永远运行? - Why does my mysql query for getting “most” data just run forever? 谁能告诉我为什么我的查询永远需要运行? - Can any body please tell me why my query take forever to run? SQL我的子查询永远加载 - SQL My Sub Query is Loading Forever
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM