Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Concern regarding Cloud Run server instance creation delays

Hello,

For the past month, I have been observing the behavior of the Cloud Run serverless scalability. When the total number of API requests exceeds the number of concurrent requests, Cloud Run takes too much time to create a new instance. Consequently, some API requests timeout, and there is a delay in redirecting the exceeded requests to the new instance. Although my API request timeout is set to 30 seconds, the API continues to return a 504 upstream timeout error. Please let me know if there are any settings missing in the Cloud Run configuration. My maximum concurrency request limit is set to 8, and I am running Node.js code on my server, which is single-threaded.

I appreciate your assistance in advance.

Thank you.

1 2 329
2 REPLIES 2

Hi @Accredian,

Welcome to Google Cloud Community!

These might help you:

  • Cold Starts: Increase API timeout or enable pre-warmed instances.
  • Resource Limits: Monitor resource usage in Cloud Monitoring and consider changing region if needed.
  • Single-threaded Node.js: Explore async/await, frameworks like Express.js, or horizontal scaling.
  • Additional Tips: Check logs and consider Cloud Functions for simple, stateless applications

Hi @Accredian, did you figure out the optimal options for fast creation of instances?