About Composite Health for automatic cross-region failover (original) (raw)

Composite Health lets service producers define criteria that determine health states for regional published services. These health states support automatic cross-region failover for service consumers that use Private Service Connect backends. The health states are based on the aggregated health of the service producer's backends (VMs or network endpoints), providing consumers with a more accurate failover signal than outlier detection, which infers health from response failures.

To enable cross-region failover, both the service producer and consumer must use a multi-region deployment. When you configure Composite Health, the health state of each regional published service is automatically propagated to the consumer's load balancer. If a published service in one region becomes unhealthy, the consumer's load balancer stops routing traffic to that service and instead routes traffic to a healthy instance of the published service that is in an alternate region.

Deployment requirements

This section describes how service producers and service consumers can configure their resources for a multi-region deployment that supports automatic cross-region failover with Composite Health.

For more information about requirements for load balancer and backend types, seeSpecifications.

Producer configuration:

Consumer configuration:

The following diagram shows a multi-region deployment:

A multi-region deployment consists of a   consumer load balancer that connects to services published in multiple regions   using Private Service Connect.

This example shows a consumer global external Application Load Balancer that connects to a service that is published in multiple regions. Accessing a multi-region service with a supported global or cross-regional load balancer lets the service consumer take advantage of Composite Health for automatic cross-region failover (click to enlarge).

Composite Health components

Composite Health uses the following components to support automatic cross-region failover.

Multiple health sources, each with a health aggregation policy,   are combined in a composite health check, which updates the Health Destination.

The preceding diagram shows the key components of Composite Health. Health aggregation policies define conditions for health sources to be considered healthy. Health states for individual health sources are combined into a single state by a composite health check, and the result is delivered to a health destination.

Health aggregation policy

A health aggregation policy is a resource that you create to define the conditions that a backend service must meet to be considered healthy. A policy aggregates the health states of a backend service's backends (VMs in an instance group or network endpoints in a NEG), as determined by regular health checks.

A backend service is considered healthy if two configurable conditions are met:

For example, you can create a policy that specifies a backend service must have at least 75% of its backends healthy and at least three healthy backends. If the number of healthy backends falls below either of those thresholds, the backend service is considered unhealthy.

Health source

A health source is a resource that makes the health of a single backend service available for aggregation as part of a composite health check. When you create a health source, you specify the following:

The health source uses the conditions defined in the health aggregation policy to determine the health state of the associated backend service.

Composite health check

A composite health check is a resource that aggregates the health states of one or more health sources to produce a single composite health state for a regional published service. The published service is considered healthy if each of the associated health sources are healthy. If any of the health sources are unhealthy, the service is considered unhealthy.

Health destination

A health destination receives the final composite health state from a composite health check. For a published service, the health destination is the forwarding rule of the producer's load balancer. The health state is automatically propagated to consumer load balancers that connect to this forwarding rule.

Specifications

Composite Health has the following specifications.

Health states

Composite Health uses the following states to represent the health of published services and backend services.

Health state Monitored resource Description
HEALTHY Health source The associated backend service is healthy as defined by its health aggregation policy.
Composite health check The published service is healthy because each of its associated health sources is healthy.
Private Service Connect NEG The associated published service is healthy as defined by the producer's composite health check.
UNHEALTHY Health source The backend service does not meet the criteria defined by its health aggregation policy.
Composite health check The published service is unhealthy because one or more of the associated health sources are unhealthy.
Private Service Connect NEG The associated published service is unhealthy as defined by the producer's composite health check; this status can trigger cross-region failover.
UNKNOWN Health source The health state is not available yet. This is a transient state that occurs when resources are newly created or configured.
Composite health check No associated health sources are unhealthy, but one or more health sources are unknown.
Private Service Connect NEG The health state of the associated published service is not available yet.

Limitations

Composite Health has the following limitations:

Pricing

For information about pricing, see VPC pricing.

What's next