Associate Cloud Engineer ยท Cloud Run operations and accelerators
Cloud Run autoscaling
Min and max instances, concurrency, CPU allocation, cold starts, and the settings to tune for latency vs cost.
Key points
- Cloud Run adds and removes instances based on load.
- Min instances (default 0) keep warm capacity and cut cold starts but cost money; max instances (default 100) cap scale-out and spend; concurrency is a per-instance request limit, so lower values mean more instances.
- CPU is allocated only during requests by default, or for the whole instance lifetime with --no-cpu-throttling.
Source: https://docs.cloud.google.com/run/docs/configuring/min-instances
Practice questions
What is the default minimum number of instances for a Cloud Run service?
- 0
- 1
- 10
- 100
Show answer
Answer: A. 0
The default is 0, so an idle service scales to zero and the next request may hit a cold start. 1 is something you configure deliberately.
Which settings help reduce the number of instances (and cost) for a service whose code handles parallel requests safely?
- Raise maximum concurrency per instance
- Raise minimum instances
- Set concurrency to 1
- Lower maximum instances
- Switch to instance-based billing
Show answer
Answer: A. Raise maximum concurrency per instance, D. Lower maximum instances
Higher concurrency lets each instance serve more requests, and a lower max-instances caps scale-out. Raising min instances adds always-on cost, concurrency 1 multiplies instances, and instance-based billing charges for idle time.
True or false: the Cloud Run concurrency setting is a target that Cloud Run always fills exactly before adding an instance.
Show answer
Answer: False
False. Concurrency is an upper limit per instance, not a target. High CPU use can make Cloud Run send fewer requests to an instance or start more instances before the limit is reached.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
