ASSOCIATE-CLOUD-ENGINEER · Question #335
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 reache
The correct answer is A. Modify the minimum number of Cloud Run instances.. 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 databas
Question
Options
- AModify the minimum number of Cloud Run instances.
- BUse traffic splitting.
- CModify the maximum number of Cloud Run instances.
- DSet a minimum concurrent requests environment variable for the application.
How the community answered
(46 responses)- A76% (35)
- B7% (3)
- C4% (2)
- D13% (6)
Explanation
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.
Topics
Community Discussion
No community discussion yet for this question.