防止 Heroku 空闲的简单方法? [英] Easy way to prevent Heroku idling?

查看:38
本文介绍了防止 Heroku 空闲的简单方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Heroku 免费应用程序中,dynos 似乎一直处于空闲状态 - 我的应用程序流量非常低,但在我的情况下,我的用户必须等待 20 秒以上才能启动新的 dyno,这也是不可接受的.

In the Heroku free apps the dynos seem to keep idling - my app has very low traffic but it's also not really acceptable in my case that my users have to wait 20+ seconds to spin up a new dyno.

坦率地说,通过这种等待,许多人甚至会在第一页显示之前就离开.

Frankly, with that kind of wait, many will leave before the first page even displays.

所以,我有一个问题:当我每天的流量达到个位数时,我是否应该每月支付 36 美元来为每个用户节省令人尴尬的 20 秒.

So, I have a problem: should I be paying $36 a month to save each user an embarrassingly long 20 seconds when my traffic is in the single-digits per day.

有没有办法解决这个问题??

Is there a way around this??

推荐答案

您可以安装免费的 New Relic 附加组件.它具有可用性监控功能,每分钟 ping 您的站点两次,从而防止 dyno 空闲.

You can install the free New Relic add-on. It has an availability monitor feature that will ping your site twice per minute, thus preventing the dyno from idling.

或多或少与 Jesse 的解决方案相同,但可能更多地与 Heroku 集成...并且有一些好处(性能监控很棒).

More or less the same solution as Jesse but maybe more integrated to Heroku... And with a few perks (performance monitoring is just great).

注意:所有那些说它不起作用的人:我的答案中的重要部分是可用性监视器".仅安装插件无济于事.您还需要使用您的 heroku 应用程序的 URL 设置可用性监控.

Note: to all those saying it doesn't work: the important part in my answer is "availability monitor". Just installing the addon won't help. You also need to setup the availability monitoring with the URL of your heroku app.

这篇关于防止 Heroku 空闲的简单方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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