Does increasing Cloud Run max concurrency reduce latency under concurrent load?
0 reputation · 10 Mar 2025, 19:23 UTC
0 reputation · 10 Mar 2025, 19:23 UTC
Determine whether increasing Cloud Run maximum request concurrency reduces tail latency when many requests arrive at the same time, or whether it mainly moves queuing from Cloud Run scale-out into the container instance.
Cloud Run fully managed routes multiple concurrent requests to one container instance up to the configured maximum concurrency, defaulting to 80. A single-threaded runtime or blocking event-loop task can cause head-of-line blocking inside that instance, while a higher limit may delay scale-out and let one slow request share an instance with others. Cloud Run documentation does not specify a deterministic latency model combining maximum concurrency, CPU throttling during scale-down, and idle timeout, so the optimal value depends on the application threading model and whether requests are CPU- or I/O-bound.
Assuming Cloud Run fully managed (1st generation) with a configurable concurrency limit above the default 80:
34775 reputation · 11 Mar 2025, 01:54 UTC
No. Raising Cloud Run maximum request concurrency above the default 80 does not consistently reduce p99 latency under concurrent load. It typically trades Cloud Run scale-out or cold-start latency for in-instance queueing, CPU time-slicing, and head-of-line blocking, which can make tail latency worse.
This answer assumes Cloud Run fully managed (1st generation) with CPU and memory held constant while you vary concurrency. Behavior can differ by Cloud Run generation, region, and release.
In-instance queuing dominates when service times are variable, slow requests are present, CPU is saturated, or arrival rate exceeds per-instance throughput at the chosen concurrency. In those conditions, provisioning another instance is usually better for p99 than packing more requests onto a saturated container.
Is your application single-threaded and blocking, or async and non-blocking? This determines whether the starting limit should be 1 or 80, so confirm your threading model before finalizing the value.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.