简体   繁体   English

如何增加 Google Cloud Run 中的 memory 限制?

[英]How to increase the memory limits in Google Cloud Run?

I'm building a simple Flask based app using Cloud Run + Cloud Firestore.我正在使用 Cloud Run + Cloud Firestore 构建一个简单的基于 Flask 的应用程序。 There is one method that brings a lot of data, and the logs are showing this error:有一种方法会带来大量数据,并且日志显示此错误:

`Memory limit of 244M exceeded with 248M used. Consider increasing the memory limit, see https://cloud.google.com/run/docs/configuring/memory-limits`

How I can increase the memory limit in the cloudbuild.yaml?如何增加 cloudbuild.yaml 中的 memory 限制? Our YAML file contains the following:我们的 YAML 文件包含以下内容:

# cloudbuild.yaml
steps:
  # build & push the container image
- name: "gcr.io/kaniko-project/executor:latest"
  args: ["--cache=true", "--cache-ttl=48h", "--destination=gcr.io/$PROJECT_ID/todo:latest"]
  # Deploy container image to Cloud Run
- name: "gcr.io/cloud-builders/gcloud"
  args: ['beta', 'run', 'deploy', 'todo', '--image', 'gcr.io/$PROJECT_ID/todo:latest', '--region', 'us-central1', '--allow-unauthenticated', '--platform', 'managed']

Thank you谢谢

In the args of the last step, add '--memory', '512Mi'在最后一步的args中,添加'--memory', '512Mi'

The format for size is a fixed or floating point number followed by a unit: G, M, or K corresponding to gigabyte, megabyte, or kilobyte, respectively, or use the power-of-two equivalents: Gi, Mi, Ki corresponding to gibibyte, mebibyte or kibibyte respectively.大小的格式是一个固定或浮点数,后跟一个单位:G、M 或 K 分别对应于千兆字节、兆字节或千字节,或使用 2 的幂等值:Gi、Mi、Ki 对应于分别为 gibibyte、mebibyte 或 kibibyte。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM