gcloud run 是否更改了最小内存限制?

问题描述 投票:0回答:4

最近的一个云运行项目之前部署得很好,内存限制为 128MB (

--memory 128M
),但今天失败并出现错误:

错误:(gcloud.run.deploy)为内存指定的值无效。对于1.0 CPU、内存必须在128Mi到4Gi之间(含)。

将配置更改为

--memory 128Mi
解决了问题,但由于兆字节大于兆字节,这对我来说看起来像是一个更改文档配额页面上没有太多关于最小限制的指示。无论如何,作为信息,以防其他人可以确认......

google-cloud-platform gcloud
4个回答
4
投票

可能是 Kubernetes 的更新...我以前可以使用

gcloud run deploy
而无需指定 cpu、内存等。

现在,如果我不指定这些设置,我会得到:

错误:(gcloud.run.deploy)spec.template.spec.containers[0].resources.limits.cpu:为 cpu 指定的值无效。对于指定值,maxScale 不得超过 10。

必须设置

--max-instances=10
才能正常工作。


1
投票

聚会迟到了,但我在错误地更改区域后遇到了这个问题。 因为显然:

实际最大限制取决于Cloud Run服务的区域及其CPU和内存配置。

(来源:https://cloud.google.com/run/docs/configuring/max-instances#limits


0
投票

2022 年 8 月更新最低内存配置的文档后,您可以看到文档中提到的更改:

最小内存设置取决于您是否首先使用 一代或二代执行环境:

  • 第一代 128 MiB
  • 第二代 512 MiB

您也可以参考答案状态:

大小的格式是固定或浮点数后跟 单位:G、M、K,分别对应千兆字节、兆字节、千字节, 分别,或使用 2 的幂当量:Gi、Mi、Ki 分别对应gibibyte、mebibyte 或kibibyte。


0
投票

TLDR;

仔细检查您的 GCP Cloud Build 清单是否未强制执行某些资源配置。

崩溃

首先,我花了几个月的时间没有查看这些部署。与此同时,GCP 更改了一些有关资源的规则。一个 CPU 与最大实例数相关。

我在 Cloud Run 上手动重新部署,最大实例数有限,但使用 Cloud Build 时,它失败了:

Deployment failed
ERROR: (gcloud.run.deploy) spec.template.spec.containers.resources.limits.cpu: Invalid value specified for cpu. For the specified value, maxScale may not exceed 5.
Consider running your workload in a region with greater capacity, decreasing your requested cpu-per-instance, or requesting an increase in quota for this region if you are seeing sustained usage near this limit, see https://cloud.google.com/run/quotas. Your project may gain access to further scaling by adding billing information to your account.

我碰巧在 Cloud Run 部署的 Cloud Build 步骤中有

--max-instances=29
。删除它可以节省一天一周

© www.soinside.com 2019 - 2024. All rights reserved.