如何修复CloudRun错误“由于没有可用实例,请求被中止" [英] How to fix CloudRun error 'The request was aborted because there was no available instance'

查看:84
本文介绍了如何修复CloudRun错误“由于没有可用实例,请求被中止"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用托管的CloudRun来部署具有concurrency=1的容器.部署后,我将并行触发四个长期运行的请求. 在大多数情况下,所有功能都可以正常工作-但偶尔,在几秒钟内,我会从其中一个节点面临500个问题;日志仅提供主题中提供的错误消息.

I'm using managed CloudRun to deploy a container with concurrency=1. Once deployed, I'm firing four long-running requests in parallel. Most of the time, all works fine -- But occasionally, I'm facing 500's from one of the nodes within a few seconds; logs only provide the error message provided in the subject.

使用具有指数补偿的重试并不能改善这种情况;重试也将以500s结束. StackDriver日志也不提供更多信息.

Using retry with exponential back-off did not improve the situation; the retries also end up with 500s. StackDriver logs also do not provide further information.

可能相关的gcloud beta run deploy自变量:

--memory 2Gi --concurrency 1 --timeout 8m --platform managed

错误消息的确切含义是什么?如何解决该问题?

What does the error message mean exactly -- and how can I solve the issue?

推荐答案

当基础结构扩展速度不足以赶上流量高峰时,可能会出现此错误消息.基础架构仅将请求保留在队列中一定时间(约10秒),然后中止请求.

This error message can appear when the infrastructure didn't scale fast enough to catch up with the traffic spike. Infrastructure only keeps a request in the queue for a certain amount of time (about 10s) then aborts it.

通常在以下情况下发生

  1. 流量突然大幅增加
  2. 冷启动时间长
  3. 请求时间很长

这篇关于如何修复CloudRun错误“由于没有可用实例,请求被中止"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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