Menu
Amazon Route 53
Developer Guide (API Version 2013-04-01)

How Health Checks Work in Complex Amazon Route 53 Configurations

Checking the health of resources in complex configurations works much the same way as in simple configurations. However, in complex configurations, you use a combination of alias records (including weighted alias, latency alias, and failover alias) and nonalias records to build a decision tree that gives you greater control over how Amazon Route 53 responds to requests. For more information, see How Health Checks Work in Simple Amazon Route 53 Configurations.

For example, you might use latency alias records to select a region close to a user and use weighted records for two or more resources within each region to protect against the failure of a single endpoint or an Availability Zone. The following diagram shows this configuration.


					Three weighted records, only two of which have health checks.

Here's how Amazon EC2 and Amazon Route 53 are configured:

  • You have Amazon EC2 instances in two regions, us-east-1 and ap-southeast-2. You want Amazon Route 53 to respond to queries by using the records in the region that provides the lowest latency for your customers, so you create a latency alias record for each region. (You create the latency alias records after you create records for the individual Amazon EC2 instances.)

  • Within each region, you have two Amazon EC2 instances. You create a weighted record for each instance. The name and the type are the same for both of the weighted records in each region.

    When you have multiple resources in a region, you can create weighted or failover records for your resources. You can also create even more complex configurations by creating weighted alias or failover alias records that, in turn, refer to multiple resources.

  • Each weighted record has an associated health check. The IP address for each health check matches the IP address for the corresponding record. This isn't required, but it's the most common configuration.

  • For both latency alias records, you set the value of Evaluate Target Health to Yes.

    You use the Evaluate Target Health setting for each latency alias record to make Amazon Route 53 evaluate the health of the alias targets—the weighted records—and respond accordingly.


					Three weighted records, only two of which have health checks.

The preceding diagram illustrates the following sequence of events:

  1. Amazon Route 53 receives a query for example.com. Based on the latency for the user making the request, Amazon Route 53 selects the latency alias record for the us-east-1 region.

  2. Amazon Route 53 selects a weighted record based on weight. Evaluate Target Health is Yes for the latency alias record, so Amazon Route 53 checks the health of the selected weighted record.

  3. The health check failed, so Amazon Route 53 chooses another weighted record based on weight and checks its health. That record also is unhealthy.

  4. Amazon Route 53 backs out of that branch of the tree, looks for the latency alias record with the next-best latency, and chooses the record for ap-southeast-2.

  5. Amazon Route 53 again selects a record based on weight, and then checks the health of the selected record. The health check passed, so Amazon Route 53 returns the applicable value in response to the query.

What Happens When You Associate a Health Check with an Alias Record?

You can associate a health check with an alias record instead of or in addition to setting the value of Evaluate Target Health to Yes. However, it's generally more useful if Amazon Route 53 responds to queries based on the health of the underlying resources—the HTTP servers, database servers, and other resources that your alias records refer to. For example, suppose the following configuration:

  • You assign a health check to a latency alias record for which the alias target is a group of weighted records.

  • You set the value of Evaluate Target Health to Yes for the latency alias record.

In this configuration, both of the following must be true before Amazon Route 53 will return the applicable value for a weighted record:

  • The health check associated with the latency alias record must pass.

  • At least one weighted record must be considered healthy, either because it's associated with a health check that passes or because it's not associated with a health check. In the latter case, Amazon Route 53 always considers the weighted record healthy.


						Three weighted records, only two of which have health checks.

If the health check for the latency alias record fails, Amazon Route 53 stops responding to queries using any of the weighted records in the alias target, even if they're all healthy. Amazon Route 53 doesn't know the status of the weighted records because it never looks past the failed health check on the alias record.

What Happens When You Omit Health Checks?

In a complex configuration, it's important to associate health checks with all of the non-alias records. Let's return to the preceding example, but assume that a health check is missing on one of the weighted records in the us-east-1 region:


						One failed health check, one record that has no health check.

Here's what happens when you omit a health check on a non-alias record in this configuration:

  1. Amazon Route 53 receives a query for example.com. Based on the latency for the user making the request, Amazon Route 53 selects the latency alias record for the us-east-1 region.

  2. Amazon Route 53 looks up the alias target for the latency alias record, and checks the status of the corresponding health checks. The health check for one weighted record failed, so that record is omitted from consideration.

  3. The other weighted record in the alias target for the us-east-1 region has no health check. The corresponding resource might or might not be healthy, but without a health check, Amazon Route 53 has no way to know. Amazon Route 53 assumes that the resource is healthy and returns the applicable value in response to the query.

What Happens When You Set Evaluate Target Health to No?

In general, you also want to set Evaluate Target Health to Yes for all of the alias records. In the following example, all of the weighted records have associated health checks, but Evaluate Target Health is set to No for the latency alias record for the us-east-1 region:


						Two failed health checks, Evaluate Target Health is No.

Here's what happens when you set Evaluate Target Health to No for an alias record in this configuration:

  1. Amazon Route 53 receives a query for example.com. Based on the latency for the user making the request, Amazon Route 53 selects the latency alias record for the us-east-1 region.

  2. Amazon Route 53 determines what the alias target is for the latency alias record, and checks the corresponding health checks. They're both failing.

  3. Because the value of Evaluate Target Health is No for the latency alias record for the us-east-1 region, Amazon Route 53 must choose one record in this branch instead of backing out of the branch and looking for a healthy record in the ap-southeast-2 region.