google-cloud-platformgoogle-cloud-rungoogle-anthos

Google cloud run running into OOM


We are building an application on Google cloud run service. The problem is, the application that we have built takes little more memory than 2gb.

Google cloud has a hard limit of 2gb on its container, and moment memory goes beyond it, the container crashes.

We are trying to find out solutions to it. Can you help us on that,

May be its an openended question, but,

  1. Is there any similar service that we can quickly switch to?
  2. Is there any facility to provide swap space for the cloudrun job? I know the consequences of using swap, and we are ok with that.

Any help is really appreciated.


Solution

  • TL;DR: Use Cloud Run for Anthos.

    With Cloud Run for Anthos you will not be limited on how big the container can be and still be able to use Cloud Run.

    Based on Google's public doc "Choosing a Cloud Run platform" the 2 GiB hard limit will not apply to Cloud Run for Anthos since the underlying is a GKE Cluster, so you will be able to use even GPUs for your containers. So for sure this is the best option for you.

    About the swap question, the answer is no. You can not enable SWAP on Cloud Run fully managed since the service it is fully controlled by Google.