首页 > 解决方案 > 为什么我的 Herokuapp 在使用时会闲置并关闭?

问题描述

为什么我的免费套餐(但信用卡已确认)Heroku 应用程序在使用时空闲并意外关闭?当它突然空闲并关闭时,我正在观看它在与应用程序的活动连接上记录我的活动。

heroku[web.1]: Idling
heroku[web.1]: State changed from up to down
heroku[web.1]: Stopping all processes with SIGTERM
heroku[web.1]: Process exited with status 143
heroku[router]: at=info method=GET path="/socket.io/?...
heroku[web.1]: Unidling
heroku[web.1]: State changed from down to starting
heroku[web.1]: Starting process with command `npm start`
app[web.1]: 
app[web.1]: > start /app<some other stuff>
app[web.1]: > node index.js $PORT
app[web.1]: 
app[web.1]: Server running on port 45155.
2heroku[web.1]: State changed from starting to up

标签: node.jsheroku

解决方案


正如 Heroku 所说

如果一个应用程序有一个免费的网络测功机,并且该测功机在 30 分钟内没有收到任何网络流量,它将休眠。

如果您的帐户还有免费的测功时间,那么它会在收到网络流量后立即生效。

个人账户每月有 550 个免费测功小时。除了这些基本时间之外,使用信用卡验证的帐户将在每月免费测功机配额中额外获得 450 小时。这意味着如果您使用信用卡验证您的帐户,您每月总共可以获得 1000 个免费测功小时。

确保您没有使用您的免费 1000 小时!!自从您的应用重新启动以来,情况显然并非如此!交通可能是问题!


推荐阅读