空闲后,heroku节点应用程序退出 [英] heroku node app exits after idling

查看:81
本文介绍了空闲后,heroku节点应用程序退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在heroku上托管了一个节点应用程序.可以正常运行,但是一旦应用在30分钟后开始空转,则该应用就会从上向下更改,并以状态0退出.

i have a node app hosted on heroku. works fine, but once the app starts idling after 30 minutes, the app changes from up to down, and exits with status 0.

2016-08-16T00:02:28.554960+00:00 heroku[web.1]: State changed from starting to up
    2016-08-16T00:35:02.601620+00:00 heroku[web.1]: Idling
    2016-08-16T00:35:02.602105+00:00 heroku[web.1]: State changed from up to down
    2016-08-16T00:35:05.902125+00:00 heroku[web.1]: Stopping all processes with SIGTERM
    2016-08-16T00:35:06.827968+00:00 heroku[web.1]: Process exited with status 0

可能是代码中的某些内容,还是我只需要保持它空闲即可?

Could it be something in the code, or do i just need to keep it from idling?

谢谢! 保罗

推荐答案

如果这是免费套餐,则这是预期的行为,这是您免费支付的价格.它应该在下一个Web请求上重新启动,但是免费层的最新条款不允许您将它保持在24/7的状态,即使有那么多请求.

If this is on the free tier then this is expected behavior, it's the price you pay for free. It should restart on the next web request to it, but the latest terms for the free tier don't let you keep it on 24/7 even if that many requests come in.

免费试用最适合您制作原型时使用.为客户提供服务后,您应该获得付款或转移到其他托管人.

Free tier is best for while you're prototyping. Once you're serving customers you should either go paid or move to a different host.

这篇关于空闲后,heroku节点应用程序退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆