Business Challenge
Posts #103 to #106 described five load balancers that differ in almost every respect. All of them delegate the same questions — which backends, how to measure their capacity, and whether they are fit to receive traffic — to one resource. A backend service defines how Cloud Load Balancing distributes traffic.
Which makes this the layer where "closest healthy backend that has capacity" is actually decided, and two of those three words behave differently from how they read.
Target capacity does not refuse anything. When all zones have reached target capacity, new requests or new connections are distributed by overfilling proportionally.
So the number steers traffic between zones and regions while there is somewhere with spare capacity to prefer, and once there is not, it stops being a constraint at all. Nothing is rejected, nothing is queued; the excess is spread across everything you own in proportion to what each backend was already carrying.
Correct approachTreat target capacity as a distribution hint and put actual load shedding somewhere that can refuse a request — rate limiting at the edge, or Cloud Armor, which #109 covers. The one hard control at this layer is the capacity scaler: the capacity scaler provides a way to scale the target capacity manually, where 0 indicates that the backend is completely drained and 0.1 (10%) - 1.0 (100%) indicates the percentage of backend capacity that is in use. That drains a backend; it still does not shed load for the service as a whole.
Both are true at once, and the documentation is precise about it. Unhealthy backends are not eligible to receive new connections; however, existing connections are *not* immediately terminated. And then: instead, the connection remains open until a timeout occurs or until traffic is dropped.
Correct approachRead "unhealthy" as "no new work", never as "disconnected". For a backend with long-lived connections — a WebSocket service, a streaming endpoint, a database proxy — being marked down can take a very long time to translate into being idle. If you need traffic off a backend promptly, drain it with the capacity scaler and let the health check do what it does, which is gatekeeping new arrivals.
Not available at that granularity: a health check's settings cannot be configured on a per-backend basis. Health checks are associated with an entire backend service.
Correct approachSplit the backend service. Since a backend service is either global or regional in scope and Application Load Balancers support several of them behind one URL map, differing health requirements are a reason to separate services rather than a setting to find. Note the corollary too — a passthrough Network Load Balancer supports exactly one backend service, so with that product the option does not exist at all.
Architecture
One resource, four decisions, and a number that is widely misread.
What the backend service owns
The backend service configuration contains a set of values, such as the protocol used to connect to backends, various distribution and session settings, health checks, and timeouts. It also decides eligibility for the features the next two posts cover — Cloud CDN, Cloud Armor security policies and Identity-Aware Proxy all attach here, not to the forwarding rule.
Among its jobs is to determine which health check is monitoring the health of the backends, and to carry the classification that #103 and #104 kept running into: the load balancing scheme is an identifier that Google uses to classify forwarding rules and backend services.
One structural fact explains a surprising amount of the previous four posts. Application Load Balancers support multiple backend services; the proxy and passthrough Network Load Balancers support one, except the regional and cross-region proxy variants when TLS routes are in play. A single backend service means no way to send different requests to different backend sets — which is why #106's passthrough load balancer has nothing resembling path-based routing. It is not a missing feature; there is nowhere to put the second destination.
Balancing mode is a unit, not a strategy
This is the sentence that reframes the whole configuration: the balancing mode defines how the load balancer measures capacity. In other words, the balancing mode is the unit by which capacity is defined.
Not an algorithm — a unit. CONNECTION defines capacity based on the number of new TCP connections; RATE defines it in HTTP requests per second; and IN_FLIGHT, UTILIZATION and CUSTOM_METRICS exist too, with availability depending on the load balancer and the backend type. Choosing a mode is choosing what "full" is measured in, which is why the available modes differ per product: a passthrough load balancer has no notion of a request, so RATE is meaningless to it.
Application Load Balancer backends carry a traffic duration setting, and its default is implicit: SHORT — recommended for HTTP requests answered with responses from backends in less than one second. If you don't explicitly specify a traffic duration, the load balancer operates as if you'd specified SHORT.
The alternative is for slower work: LONG — recommended for HTTP requests for which the backend needs more than one second to generate responses.
It matters because the documentation publishes two different balancing-mode tables, one per duration setting. So a service whose responses routinely take several seconds is being measured by a capacity model tuned for sub-second replies, and the fix is a flag most deployments have never touched. Worth checking on anything doing report generation, large queries or AI inference.
The capacity arithmetic, and the change that invalidates it
Two parameter families look interchangeable and are not. The per-zone form: when you specify the max-connections parameter, the value you provide defines the capacity for an entire zone, and likewise max-rate — target HTTP request rate per backend zone. The per-instance form multiplies: if you set max-connections-per-instance to X, the zonal target capacity is N * X. This is equivalent to setting max-connections to N * X.
So the same number means wildly different things depending on which flag carries it, and the difference scales with your instance count. Then a compatibility rule that bites during a migration: regional managed instance groups don't support the max-connections parameter because they consist of multiple zones. Instead, use the max-connections-per-instance parameter. Converting a zonal MIG to a regional one therefore invalidates a per-zone capacity setting, and the capacity model has to be re-expressed rather than carried over.
One detail in the averages repays attention because it describes behaviour under failure. If you set max-rate to X, the zonal target capacity is X requests per second. The average requests per second per instance is X / h — where h is the healthy count, not the total. As backends fail health checks, the same zonal capacity is divided among fewer instances, so per-instance load rises while the zone's target stays put. The capacity model does not shrink when the fleet does.
And a whole class of backend sits outside this model entirely: internet NEGs, serverless NEGs, and Private Service Connect NEGs don't support the balancing mode, target capacity, and capacity scaler parameters. As does one whole load balancer — even though the backends of regional passthrough Network Load Balancers are set to the CONNECTION balancing mode, the load balancer doesn't support a target capacity or a capacity scaler. A mode with no capacity attached to it, which is as close to decorative as a setting gets.
What a health check computes
The mechanism is plain. Each connection attempt is called a probe, and based on a configurable number of sequential successful or failed probes, an overall health state is computed for each backend. That state has exactly one consequence: the overall health state of each backend determines eligibility to receive new requests or connections.
Two asymmetries are worth holding. First, the thresholds are independent — backends that fail to respond successfully for a separately configurable number of times are unhealthy — so how fast a backend leaves the pool and how fast it rejoins are different decisions. Second, and more useful operationally: newly added backends might be considered healthy after a single successful probe. New capacity joins almost immediately; failing capacity leaves on its own schedule.
The probe timing is defined precisely enough to reason about: the check interval is the amount of time from the start of one probe issued by one prober to the start of the next probe issued by the same prober, with the timeout — the amount of time that Google Cloud waits for a response to a probe. Its value must be less than or equal to the check interval. And because each health check or legacy health check that you create is implemented by multiple probes, your backend sees more probe traffic than one interval would suggest.
Health checks implemented by dedicated software tasks use special routes that aren't defined in your Virtual Private Cloud (VPC) network, and the probe IP ranges belong to Google. This is the same pattern as #104's GFE ranges and #99's 35.199.192.0/19: the traffic is real, the source is Google's, and the path is not in your route table.
One exemption saves confusion when auditing: packets from the metadata server are always allowed. You will not find a firewall rule permitting it because none is needed.
Two one-way doors
Both are cheap to avoid at design time and expensive afterwards.
Legacy health checks cannot be converted, in either direction. You cannot convert a legacy health check to a health check, and you cannot convert a health check to a legacy health check. The good news is that you rarely need one: only target pool-based regional external passthrough Network Load Balancers require legacy health checks — which, with #106's note that target pools are the legacy backend, means a legacy health check is a sign you are on an old path rather than a choice you made.
The protocol question has a right answer and a permissive rule. It's best to use a health check (or legacy health check) whose protocol matches the protocol used by the load balancer's backend service or target pool. However, the health check protocols and load balancer protocols do not need to be the same. So a mismatch is allowed, which means it is also easy to ship by accident — a TCP health check in front of an HTTP service reports healthy as long as the socket opens, including when the application behind it is returning errors.
And one requirement that is easy to miss because it has no default: you must specify a port for your health check.
Why This Architecture Holds Up
#104 said a global external Application Load Balancer directs traffic to the closest healthy backend that has capacity, and #106 said a global passthrough balancer spills over when a region is at capacity. Both are true, and both describe a preference rather than a rule.
The mechanism is now visible. Target capacity ranks destinations: while some zone or region is under its target, traffic prefers it, which is what produces the spillover behaviour and the region-by-region failover. But the moment every zone is at target, the ranking has nothing left to prefer, and the documented outcome is not refusal — it is distributed by overfilling proportionally.
So capacity in Cloud Load Balancing is a routing input, not an admission control. A system that was going to collapse under overload still collapses; what the load balancer guarantees is that it collapses evenly.
Target capacity decides where traffic goes. It never decides whether traffic goes.
Which splits the work in two. Distribution is this layer's job, and it does it well: set the balancing mode to the unit that reflects what actually exhausts your backend, express capacity in the parameter family that matches your instance group type, and let the health check gate arrivals. Admission control is somebody else's job — a rate limit, a quota, Cloud Armor, or a backend that sheds load itself.
The failure mode to watch for is a team that set max-rate as a safety limit, because it reads like one. It is a steering weight, and under the only conditions where a safety limit would matter, it has stopped having an effect.
One configuration that produces 503s with no obvious cause
A trap worth knowing before it costs a morning, from the IPv6 section: if the backends are IPv4-only and the IP address selection policy is set to IPv6 only, the configuration results in unhealthy backends because traffic fails to reach those backends and the HTTP 503 response code is returned to the clients.
Note the shape of it. The backends are healthy in themselves; the health check cannot reach them; the symptom is a 503 at the client. Nothing in the backend's own logs explains it, because nothing arrived. That is the same class as every other failure in this block — a correct-looking configuration whose effect is somewhere other than where you would look.
Key Architecture Decisions
| Situation | Decision | Because |
|---|---|---|
| Wanting to shed load with max-rate | It will not; use a rate limit or Cloud Armor | At saturation, traffic is distributed by overfilling. |
| Needing traffic off a backend now | Capacity scaler to 0 | It is the only hard control at this layer. |
| Draining a backend service's only backend | Not allowed; add another first | A scaler of 0 is refused on a sole backend. |
| Reading "unhealthy" as "disconnected" | It means no new connections only | Existing connections stay open until a timeout. |
| Long-lived connections on a failing backend | Drain it rather than wait for the health check | Marking down does not terminate anything. |
| Different health check for one backend | Split the backend service | Health checks apply to the whole service. |
| Wanting path-based routing on a passthrough NLB | Not possible | It supports a single backend service. |
| Choosing a balancing mode | Pick the unit that reflects what exhausts the backend | The mode is the unit capacity is measured in. |
| Backends that take seconds to respond | Set traffic duration to LONG | SHORT is assumed, and tuned for sub-second replies. |
| Converting a zonal MIG to regional | Re-express capacity per instance | Regional MIGs do not support max-connections. |
| Capacity planning under partial failure | Expect per-instance load to rise | Averages divide by healthy count, not total. |
| Serverless, internet or PSC NEG backends | No capacity model applies | They support none of those three parameters. |
| Regional passthrough NLB capacity tuning | There is none to tune | It supports no target capacity or capacity scaler. |
| A TCP health check on an HTTP service | Match the protocol | A mismatch is allowed and hides application errors. |
| Finding a legacy health check in use | Treat it as a migration signal | Only target-pool load balancers require them. |
| Planning to convert a legacy health check | Not possible in either direction | Create the new one and move the backend service. |
| Firewall rules for health check probes | Allow Google's probe ranges | Probes use routes not defined in your VPC network. |
| Unexplained 503s with healthy-looking backends | Check the IP address selection policy | IPv6-only against IPv4 backends produces exactly that. |
The one to look at today
For each backend service, write down the balancing mode, the capacity parameter and whether that parameter is the per-zone or per-instance form — then check the instance group type matches it. A regional managed instance group behind a per-zone capacity setting is misconfigured in a way nothing reports. While there, note whether anyone set max-rate expecting it to protect the backends; if so, that protection does not exist, and the honest place to add it is in front of the load balancer rather than inside it.
Closing Thought
Five posts of load balancers, and the one that explains them is this one. The reason a passthrough Network Load Balancer cannot do path-based routing is that it has one backend service. The reason RATE is unavailable on it is that capacity is measured in a unit it has no concept of. The reason #104's global balancer can prefer a nearer region is that target capacity ranks destinations. And the reason that preference evaporates under load is a single sentence about overfilling.
Which is the pattern this whole networking block has been teaching, arriving one last time: the behaviour you observe is rarely explained at the layer where you observed it. The load balancer's routing is explained by the backend service's capacity model, the backend service's health is explained by probes on routes you cannot see, and the thing you thought was a limit was a weight all along.
#108 attaches the first of the features that hang off the backend service: Cloud CDN and its cache modes — where a cache hit is decided, and what the three modes actually change about who is in charge of cacheability.
Official Google Cloud Reference
- Backend services overview
- Health checks overview
- Create and manage health checks
- Network endpoint groups overview
- Zonal network endpoint groups
- Load testing a backend service
- Enabling connection draining
- Health check logging
- Firewall rules for load balancers
- Load balancer resource model
- Choose a load balancer
- Load balancer feature comparison
Comments