在Grails应用程序中避免Heroku引导超时 [英] Avoid Heroku Boot timeout on Grails App

查看:113
本文介绍了在Grails应用程序中避免Heroku引导超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在heroku雪松中部署了一个grails应用程序,我们的应用程序需要超过60秒才能启动,并根据 heroku


Web进程花费了超过60秒的时间来绑定到其分配的
$ PORT。当发生这种情况时,dyno的进程被杀死,dyno的
被认为崩溃了。

我们减少了依赖关系,有些情况下启动需要超过60秒,所以我们的应用程序被heroku阻止。



你知道一些方法来避免这种情况吗?
<解决方案我有一个很好的解决方案:我分叉了Grails构建包,并添加了一些代码,强制Jetty绑定到 $ PORT 提前,以便Grails可以随时启动它想要的启动;在Grails启动期间,请求只会失败并出现404错误,但至少应用程序可以可靠启动。




p>使用它:

  heroku config:set BUILDPACK_URL = https://github.com/funfork/heroku-buildpack- grails-earlybind 

如果您需要强制重新编译slug(确保您没有提交待处理):

  git commit --allow-empty -m空提交
git push heroku master

在这里,你去!


We have a grails app deployed in heroku cedar, our app takes more than 60 seconds to start, and according to heroku:

A web process took longer than 60 seconds to bind to its assigned $PORT. When this happens, the dyno’s process is killed and the dyno is considered crashed

we reduced dependencies as posible but in some occasions the startup takes more than 60 seconds, so our app is stopped by heroku.

Do you know some way to avoid this?

解决方案

I have a nice solution for this problem: I forked the Grails buildpack and added a bit of code that forces Jetty to bind to the $PORT early, so that Grails can take all the time it wants to start up; during the Grails startup time, requests simply fail with a 404 error, but at least the app starts reliably.

https://github.com/funfork/heroku-buildpack-grails-earlybind

To use it:

heroku config:set BUILDPACK_URL=https://github.com/funfork/heroku-buildpack-grails-earlybind

And if you need to force a slug recompile (ensure that you have no commit pending first):

git commit --allow-empty -m "empty commit"
git push heroku master

And here you go!

这篇关于在Grails应用程序中避免Heroku引导超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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