在 Heroku 部署期间请求会发生什么?

What happens to requests during a Heroku deploy?

Heroku 路由器是否会在部署应用程序并准备好处理它们之前保留请求?

如果可以快速部署 Rails 或 Rack 应用程序,所有请求都由该应用程序处理?还是 Heroku 路由器 return 503 或其他状态代码?

我的印象是有 30 秒的停机时间,请求将丢失。除非请求被发送到诸如 redis 或 sidekiq 之类的地方,否则它们可能会被保存。这就是我使用 preboot 的原因。 在部署完成后大约 3 分钟进行预启动,HTTP 请求将开始路由到新的测功机,同时停止路由到旧的测功机。

Instead of stopping the existing set of web dynos before starting the new ones, preboot ensures that the new web dynos are started (and receive traffic) before the existing ones are terminated. This can contribute to zero downtime deployments.