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

How Health Checks Work in Simple Amazon Route 53 Configurations

The simplest configuration for which checking the health of your resources is useful is when you have two or more resources that are performing the same function. For example, you might have multiple Amazon EC2 servers running HTTP server software responding to requests for the example.com website. In Amazon Route 53, you create a group of resource record sets that have the same name and type, such as weighted resource record sets or latency resource record sets of type A. You create one resource record set for each resource, and you configure Amazon Route 53 to check the health of the corresponding resource. In this configuration, Amazon Route 53 chooses which resource record set will respond to a DNS query for example.com and bases the choice in part on the health of your resources.

As long as all of the resources are healthy, Amazon Route 53 responds to queries using all of your example.com weighted resource record sets. When a resource becomes unhealthy, Amazon Route 53 responds to queries using only the healthy resource record sets for example.com.

Here's an overview of how you configure Amazon Route 53 to check the health of your resources in this simple configuration and how Amazon Route 53 responds to queries based on the health of your resources:

  1. You identify the resources whose health you want Amazon Route 53 to monitor. For example, you might want to monitor all of the HTTP servers that respond to requests for example.com.

  2. You create health checks for your resources. A health check tells Amazon Route 53 how to send requests to the endpoint whose health you want to check: which protocol to use (HTTP, HTTPS, or TCP), which IP address and port to use, and, for HTTP/HTTPS health checks, a domain name and path.

    A common configuration is to create one health check for each resource and to use the same IP address for the health check endpoint as for the resource. If the IP address for your HTTP server is 192.0.2.117, you create a health check for which the IP address is 192.0.2.117.

    Note

    Amazon Route 53 cannot check the health of endpoints for which the IP address is in local, private, nonroutable, or multicast ranges. For more information about IP addresses for which you cannot create health checks, see RFC 5735, Special Use IPv4 Addresses and RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space.

    For more information about creating health checks by using the Amazon Route 53 console, see Creating, Updating, and Deleting Health Checks. For information about creating health checks by using the Route 53 API, see CreateHealthCheck in the Amazon Route 53 API Reference.

  3. You might need to configure router and firewall rules so that Amazon Route 53 can send regular requests to the endpoints that you specified in your health checks. For more information, see Configuring Router and Firewall Rules for Amazon Route 53 Health Checks.

  4. You create a group of resource record sets for your resources, for example, a group of weighted resource record sets that all have a type of A. You associate the health checks that you created in step 2 with the corresponding resource record sets. When you're finished, your configuration looks similar to the following diagram:

    
							Three weighted resource record sets and corresponding health checks.

    For more information about creating resource record sets by using the Amazon Route 53 console, see Creating Resource Record Sets by Using the Amazon Route 53 Console. For information about creating resource record sets by using the Amazon Route 53 API, see ChangeResourceRecordSets in the Amazon Route 53 API Reference.

  5. Amazon Route 53 periodically sends a request to each endpoint that you specified when you created your health checks; it doesn't perform the health check when it receives a DNS query. Based on the responses, Amazon Route 53 decides whether the endpoints are healthy and uses that information to determine how to respond to queries. For more information, see How Amazon Route 53 Determines Whether an Endpoint Is Healthy.

    Important

    Amazon Route 53 doesn't check the health of the resource specified in the resource record set, such as the IP address specified in an A record for example.com. When you associate a health check with a resource record set, Amazon Route 53 begins to check the health of the endpoint that you specified in the health check.

  6. Here's what happens when Amazon Route 53 receives a query for example.com:

    1. Amazon Route 53 chooses a resource record set based on the routing policy. In this case, it chooses a resource record set based on weight.

    2. It determines the current health of the selected resource record set by checking the status of the health check for that resource record set.

    3. If the selected resource record set is unhealthy, it repeats the process of choosing a resource record set based on the routing policy. This time, the unhealthy resource record set isn't considered.

    4. It responds to the query with the selected healthy resource record set.

The following example shows a group of weighted resource record sets in which the third resource record set is unhealthy. Initially, Amazon Route 53 selects a resource record set based on the weights of all three resource record sets. If it happens to select the unhealthy resource record set the first time, Amazon Route 53 selects another resource record set, but this time it omits the weight of the third resource record set from the calculation:

  • When Amazon Route 53 initially selects from among all three resource record sets, it responds to requests using the first resource record set about 20% of the time, 10/(10 + 20 + 20).

  • When Amazon Route 53 determines that the third resource record set is unhealthy, it responds to requests using the first resource record set about 33% of the time, 10/(10 + 20).


					Three weighted resource record sets and corresponding health checks.

If you omit a health check from one or more resource record sets in a group of resource record sets, Amazon Route 53 treats those resource record sets as healthy. Amazon Route 53 has no basis for determining the health of the corresponding resource and might choose a resource record set for which the resource is unhealthy.


					Three weighted resource record sets, only two of which have health checks.