Monitoring and Optimization · Topic 4 of 6

Availability and Health Monitoring

Monitor availability with EC2 status checks, load balancer metrics, Route 53 health checks, Synthetics, X-Ray and AWS Health to find and fix faults.

  • 5 min
In a nutshell
  • EC2 has system status checks (host) and instance status checks (guest OS).
  • Alarm action recover handles system status failures and keeps the instance ID and IP addresses.
  • Target 5XX means the application failed, and ELB 5XX means the load balancer could not do its job.

What it is

Availability monitoring answers a simple question: can users reach the service and does it work? AWS gives you several layers of signals, from the host, to the load balancer, to the user's view.

Good operators check these layers in order, so they know whether a fault is in the instance, the application path, the network or AWS itself.

Synthetics canaryuser viewcallsLoad balancerHTTP codes and targetsroutes toEC2 instancestatus checksrunsApplicationlogs and traces

How it works

EC2 status checks

EC2 runs two checks every minute. The system status check looks at the underlying host, such as power, network and hardware. The instance status check looks at the guest operating system and its network configuration.

CheckWhat a failure points toTypical fix
System status checkProblem with the AWS hostStop and start the instance (moves to new hardware), or use auto recovery
Instance status checkProblem inside the OS, such as bad network config or full diskReboot, or fix the OS settings

A CloudWatch alarm on StatusCheckFailed_System can use the EC2 recover action. Recovery keeps the instance ID, private IP address and other identity details. This works for EBS (Elastic Block Store) backed instances, and not for instances with instance store volumes.

Load balancer metrics

Elastic Load Balancing publishes metrics that tell you where an error happens. Learn to separate errors produced by the load balancer from errors produced by your targets.

MetricMeaning
HealthyHostCount and UnHealthyHostCountTargets passing or failing health checks
HTTPCode_Target_5XX_CountServer errors returned by your application
HTTPCode_ELB_5XX_CountErrors generated by the load balancer itself
TargetResponseTimeLatency from the targets
RequestCountTraffic volume

If target 5XX counts rise, look at the application and its logs. If load balancer 5XX counts rise while targets look fine, check target capacity, health checks and the load balancer's own limits.

Route 53 health checks

Amazon Route 53 health checkers around the world can probe an endpoint by HTTP, HTTPS or TCP. A health check can also be a calculated check that combines other checks, or one that follows a CloudWatch alarm state.

Health checks drive DNS failover, which is covered in the reliability chapter. They can raise a CloudWatch alarm too, which lets you notify people through SNS.

CloudWatch Synthetics

Synthetics runs canaries, which are scripts on a schedule that act like a user, for example loading a page or calling an API. A canary finds problems even when there is no real traffic, and it gives you a success rate and latency metric to alarm on.

Tracing with X-Ray

AWS X-Ray follows a request through several services and builds a service map. Use it to find which downstream call is slow or failing in a microservice or serverless application. The application must send trace data, for example through the X-Ray SDK or agent.

AWS Health

The AWS Health Dashboard has two parts. The service health view shows the status of AWS services, and the account view shows events that affect your own resources, such as scheduled maintenance or an instance that must be retired.

Health events also arrive in EventBridge, so you can route them to a team or an automation.

Typical diagnosis order
1. AWS Health: is AWS itself reporting a problem?
2. Load balancer metrics: 4XX or 5XX, which side?
3. Target health: healthy host count, status checks
4. Logs and traces: why the application failed
Exam tip

Recover is for a failed system status check (the host), while reboot is for a failed instance status check (the OS). The exam likes this difference.

What to remember for the exam

  • EC2 has system status checks (host) and instance status checks (guest OS).
  • Alarm action recover handles system status failures and keeps the instance ID and IP addresses.
  • Target 5XX means the application failed, and ELB 5XX means the load balancer could not do its job.
  • Route 53 health checks can probe endpoints, combine other checks, or follow a CloudWatch alarm.
  • Synthetics canaries test availability from a user's point of view on a schedule.
  • X-Ray traces requests across services to find slow or failing components.
  • AWS Health account view shows events that affect your resources, and these can go to EventBridge.
  • Detailed monitoring gives one minute metrics when five minutes is too coarse.

Common mistakes

Treating all 5XX as an application bug. The metric name tells you whether the load balancer or the target created the error.

Using reboot for a host fault. If the system status check fails, rebooting often does not move the instance. Stop and start, or use recover.

Watching only CPU. An application can be down while CPU is low. Add health checks, error rates and canaries.

Forgetting that health checks need a path. A target that returns an error on the health check path is marked unhealthy even if the rest of the site works.

Watch out

Health checks that are too strict, such as ones that depend on a database, can mark every target unhealthy at once and take the whole service offline.

Check yourself

Quick questions.

  • Which EC2 check failing means a problem with the underlying host?

    The system status check, and the usual fix is recover or stop and start.

  • What does a rising HTTPCode_Target_5XX_Count show?

    The registered targets, meaning your application, are returning server errors.

  • Which service tests a website from the user's view on a schedule?

    CloudWatch Synthetics canaries.

Topic 4 of 6 in Monitoring and Optimization

Test yourself on Monitoring and Optimization

The full AWS SOA-C03 question bank has 850 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by AWS. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.