Improved Health Checks
The logical (domain name) to physical (IP address) mapping that you get when you use a DNS service such as Route 53 greatly simplifies the process of building applications and services that are highly available. Route 53 improves on this fundamental DNS property by adding health checks and DNS failover capabilities. You can easily configure Route 53 to check the health of your website on a regular basis, and to switch to a backup site if the primary one is unresponsive.
You can now configure your Route 53 health checks to use the presence of a designated string in a server response to indicate that the server is performing as desired. The string (up to 255 characters long) must appear in the first 5,120 bytes of the response body.
You can use this feature in a couple of different ways. You can check the website itself to make sure that the HTML it serves up contains an expected string. Or, you can create a status checking routine and use it to check the health of the server from an internal or operational perspective. Suppose I take the latter route and decide that accessing check_server.php will return a simple XML string containing the status of the server. Here’s how I would configure a Route 53 health check for this use case: