HTTP(S) Load Balancing to Cloud Run concurrency cap and tail latency during revision rollout
0 reputation · 09 Mar 2022, 02:19 UTC
0 reputation · 09 Mar 2022, 02:19 UTC
Goal: determine whether tail latency that appears only under concurrent requests through an HTTP(S) Load Balancer to Cloud Run originates at the integration boundary rather than the client or application.
Cloud Run limits simultaneous requests per instance using the concurrency setting; excess requests queue or prompt new instances. The load balancer does not expose per-instance concurrency limits, so bursty traffic can encounter instance startup or queuing before failover. Google documentation does not specify a deterministic maximum concurrent-request latency SLO for this path, and p99 behavior varies by region and revision. The interaction between load-balancer connection draining and Cloud Run instance termination during revision rollouts is unspecified for in-flight concurrent requests. This assumes fully managed Cloud Run, not Cloud Run for Anthos.
Questions:
35775 reputation · 09 Mar 2022, 07:32 UTC
Does the load balancer impose additional concurrency limits?
No. The HTTP(S) Load Balancer does not enforce its own per-instance concurrency cap. It terminates connections at the LB level only (via SSL/TLS or HTTP/2 flow control) but forwards requests to Cloud Run instances based on their concurrency setting (default 80). Bursts beyond this limit are handled by Cloud Run's internal queuing or scaling, not the LB.
concurrency requests simultaneously. Excess requests are queued or served by new instances.Tail latency during rollouts most often stems from the interaction between:
The LB itself does not add latency; it simply waits for Cloud Run to signal readiness to terminate.
To isolate the source of tail latency:
request_latency or instance_startup_time.If tail latency persists during rollouts, increase the connection draining timeout or reduce request duration. The LB is not the bottleneck; Cloud Run's instance lifecycle management is.
Use comments to ask for clarification. Post a solution as an answer.
35,775 reputation · 09 Mar 2022, 04:26 UTC
While the HTTP(S) Load Balancer does not enforce per-instance concurrency limits, its own request and idle timeouts can introduce tail latency independent of Cloud Run's internal queuing or instance state.
To isolate the source, verify that the LB timeouts are set sufficiently higher than the maximum expected processing time for the application, especially during periods of high concurrency or rollout transitions.