Monitoring, Logging, Analysis, Remediation, and Performance Optimization

The CloudWatch agent on an EC2 instance already publishes mem_used_percent. When memory use stays above 90% for 10 minutes, the application's service must be restarted automatically. Which configuration meets this requirement?

Show the answer

Correct answerB. A mem_used_percent alarm whose ALARM state triggers an EventBridge rule that starts an Automation runbook to restart the service

AWhy not this: System status checks report problems with AWS infrastructure, not guest memory use, and recovery moves the instance rather than restarting the service.

BWhy this is right: The alarm detects sustained high memory use, and EventBridge starts the runbook that restarts the service without human action.

CWhy not this: RunInstances API calls show instance launches, not memory use on a running instance.

DWhy not this: An email notification relies on a person to act, so the restart is not automatic.

An alarm on the agent's memory metric detects the condition, and an EventBridge rule on the alarm's state change can start a Systems Manager Automation runbook that restarts the service. The EC2 recover action responds to system status check failures on AWS hardware, not to memory pressure inside the guest.