Zero downtime on Heroku

前端 未结 4 1659
一整个雨季
一整个雨季 2021-02-13 22:12

Is it possible to do something like the Github zero downtime deploy on Heroku using Unicorn on the Cedar stack?

I\'m not entirely sure how the restart works on Heroku

4条回答
  •  梦如初夏
    2021-02-13 22:26

    You might be interested in their feature called preboot.

    Taken from their documentation:

    This feature provides seamless deploys by booting web dynos with new code before killing existing web dynos.

    Some apps take a long time to boot up, and this can cause unacceptable delays in serving HTTP requests during deployment.

    There are a few caveats:

    • You must have at least two web dynos to use this feature. If you have your web process type scaled to 1 or 0, preboot will be disabled.
    • Whoever is doing the deployment will have to wait a few minutes before the new code starts serving user requests; this happens later than it would without preboot (but in the meanwhile, user requests are still served promptly by old dynos).
    • There will be a short period (a minute or two) where heroku ps shows the status of the new code, but user requests are still being served by old code.

    There is much more information about it, so refer to their documentation.

提交回复
热议问题