【问题标题】:How to increase the memory limits in Google Cloud Run?如何增加 Google Cloud Run 中的内存限制?
【发布时间】:2020-09-16 08:30:36
【问题描述】:

我正在使用 Cloud Run + Cloud Firestore 构建一个基于 Flask 的简单应用。有一种方法会带来大量数据,并且日志显示此错误:

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

如何增加 cloudbuild.yaml 中的内存限制?我们的 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']

谢谢

【问题讨论】:

    标签: python flask google-cloud-platform containers google-cloud-run


    【解决方案1】:

    在最后一步的args中,添加'--memory', '512Mi'

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

    【讨论】:

    • 谢谢 steren 和 @wietse-venema
    猜你喜欢
    • 2019-10-14
    • 2018-12-26
    • 1970-01-01
    • 2023-01-20
    • 2019-10-27
    • 2012-03-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多