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

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

问题描述

在Heroku免费应用程序中,dynos似乎保持空闲状态 - 我的应用程序的流量非常低,但在我的情况下,我的用户不得不等待20多秒才能启动新的dyno。



坦率地说,有了这样的等待,很多人会在第一页显示之前离开。



所以,我遇到了一个问题:我应该每月支付36美元来保存每个用户一个令人尴尬的长达20秒,当我的流量是每天的单位数。



解决方法

您可以安装免费的 New Relic附加组件。它具有可用性监视功能,可以每分钟对您的网站进行两次ping,从而防止dyno空转。

或多或少与Jesse相同,但可能更集成Heroku ...还有一些额外的好处(性能监控非常棒)。



注意: :我的答案中的重要部分是可用性监视器。只需安装插件将无济于事。您还需要使用您的heroku应用程序的URL设置可用性监控。



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.

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??

解决方案

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.

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

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天全站免登陆