Question 36
Domain 4: ML Solution Monitoring, Maintenance, and SecurityAn ML engineer wants an Amazon SageMaker notebook to automatically stop running after 1 hour of idle time. How can the ML engineer accomplish this goal?
Correct answer: A
Explanation
Amazon SageMaker notebook instances can use a lifecycle configuration to run scripts when the notebook starts. The auto-stop-idle script from GitHub can be added to the Start Notebook section so the instance stops after "1 hour of idle time." This matches the goal of automatic shutdown after inactivity.
Why each option is right or wrong
A. Create a lifecycle configuration in SageMaker. Copy the auto-stop-idle script from GitHub to the Start Notebook section.
Amazon SageMaker notebook instances support lifecycle configurations, which are scripts executed at instance start or creation via the Start Notebook section. AWS provides an auto-stop-idle script in GitHub that can be attached there to monitor inactivity and stop the notebook instance after 60 minutes of idle time, matching the 1-hour requirement. Without a lifecycle configuration, SageMaker notebook instances do not natively enforce an idle shutdown timer.
B. Create a lifecycle configuration in SageMaker. Copy the auto-stop-idle script from GitHub to the Create Notebook section.
Create Notebook runs only during instance creation, not on every subsequent notebook start.
C. Track the notebook's CPU metric by using Amazon CloudWatch Logs. Invoke an AWS Lambda function from CloudWatch Logs to shut down the notebook instance if CPU utilization becomes zero.
CPU utilization is not a reliable proxy for notebook idleness and CloudWatch Logs is the wrong focus.
D. Track the notebook's memory metric by using Amazon CloudWatch Logs. Invoke an AWS Lambda function from CloudWatch Logs to shut down the notebook instance if memory utilization becomes zero.
Memory usage usually persists above zero, so it does not indicate true notebook inactivity.