Resources Cloud Run

Hi,
I’m using Cloud Run to deploy a backend built with FastApi via a docker container.
I’ve allocated 8 CPUs and 32 GiB of memory resources. However, when I test my app, it times out on an action that takes only a few seconds to complete on my personal computer locally. I don’t understand where the problem is coming from, unless it’s related to the resources provided by GCP.
Any ideas ?

Hi @JSHS_Valence ,

Welcome to Google Cloud Community!

I understand that your application gets time out white testing. Are you getting any error messages? Also can you share to us the logs from the Cloud Run? This will help us troubleshoot your issue. For the meantime, you may try the following and see if it fixes the issue:

  1. Set the request timeout of your service in Cloud Run, the request timeout setting specifies the time within which a response must be returned by services deployed to Cloud Run.
  2. Change the execution environment of your service in Cloud Run, this will improve the CPI and network performance.

I hope the above information is helpful.

Hi,
The only message I got is the following

Even after setting the request timeout to 10 minutes, I keep encountering the same error. It doesn’t seem normal for the action to take this long.

For the environment, it’s set to Default. It’s not in production, only in testing, and I’m the only one working on it. Do you think I should change it to First or Second generation?

Someone also mentioned the firewall. Do you think that could be related?

Many thanks for your help.

Hi @JSHS_Valence ,

Most of the time, timeout errors are due to network connectivity issues. Please check your network connectivity and if you suspect a firewall issue, you can try to disable your firewall temporarily. This can help isolate whether the firewall is the root cause. You can also look for any blocked connections or error messages related to your Cloud Run requests in your firewall.

Also ensure that your local environment (e.g., Docker) is configured with the same timeout settings as your Cloud Run service. Check also your Docker container’s configuration. Sometimes, resource limits in Docker can affect response times.