Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase the memory limits in Google Cloud Run?

I'm building a simple Flask based app using Cloud Run + Cloud Firestore. 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? Our YAML file contains the following:

# 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

like image 359
marcosluis2186 Avatar asked Dec 23 '22 17:12

marcosluis2186


1 Answers

In the args of the last step, add '--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.

like image 55
Wietse Venema Avatar answered Dec 28 '22 08:12

Wietse Venema