Associate Cloud Engineer Exam QuestionsBrowse all questions from this exam

Associate Cloud Engineer Exam - Question 278


Your web application is hosted on Cloud Run and needs to query a Cloud SQL database. Every morning during a traffic spike, you notice API quota errors in Cloud SQL logs. The project has already reached the maximum API quota. You want to make a configuration change to mitigate the issue. What should you do?

Show Answer
Correct Answer: A

Modifying the minimum number of Cloud Run instances ensures that there are always some instances running, even during periods of low traffic. This helps to mitigate the problem of cold starts, which can generate a large number of concurrent API calls to Cloud SQL during traffic spikes. By keeping some instances always ready, the load on the Cloud SQL API is spread more evenly, helping to stay within quota limits.

Discussion

1 comment
Sign in to comment
RuchiMishraOption: A
Jul 16, 2024

Here's why A is the most effective solution to mitigate API quota errors during traffic spikes: Cold Starts and API Calls: Cloud Run services scale to zero when not in use. When a new request arrives, a new instance is spun up, leading to a cold start. During this cold start, multiple API calls might be made to initialize the application and connect to the Cloud SQL database. If there's a sudden spike in traffic, a large number of cold starts can occur simultaneously, exceeding the Cloud SQL API quota. Minimum Instances: By setting a minimum number of Cloud Run instances, you can ensure that a few instances are always running, even during periods of low traffic. This eliminates cold starts during traffic spikes and reduces the number of concurrent API calls made to Cloud SQL, helping you stay within the quota limits.