📖 Scenario: You manage a web application hosted on AWS. Traffic to your app changes predictably during the day. You want to prepare your servers to handle these changes automatically without manual intervention.
🎯 Goal: Build a simple AWS Auto Scaling configuration that uses predictive scaling to adjust the number of servers ahead of traffic changes.
📋 What You'll Learn
Create an Auto Scaling group with a launch template
Define a predictive scaling policy for the Auto Scaling group
Set a target tracking scaling policy for comparison
Verify the Auto Scaling group has predictive scaling enabled
💡 Why This Matters
🌍 Real World
Predictive scaling helps cloud applications automatically adjust resources before traffic spikes, improving performance and cost efficiency.
💼 Career
Cloud engineers and DevOps professionals use predictive scaling to optimize infrastructure and maintain application availability.
Progress0 / 4 steps
1
Create an Auto Scaling group with a launch template
Write AWS CLI commands to create a launch template named MyLaunchTemplate with the latest Amazon Linux 2 AMI and instance type t3.micro. Then create an Auto Scaling group named MyAutoScalingGroup using this launch template, with minimum size 1, maximum size 5, and desired capacity 1.
AWS
Hint
Use aws ec2 create-launch-template with --launch-template-data JSON to specify AMI and instance type. Then use aws autoscaling create-auto-scaling-group referencing the launch template.
2
Define a predictive scaling policy for the Auto Scaling group
Write an AWS CLI command to create a predictive scaling policy named MyPredictiveScalingPolicy for the Auto Scaling group MyAutoScalingGroup. Set the policy type to PredictiveScaling and configure it to maintain a target capacity of 70 percent of the forecasted load.
AWS
Hint
Use aws autoscaling put-scaling-policy with --policy-type PredictiveScaling and specify --predictive-scaling-configuration JSON with TargetCapacity.
3
Add a target tracking scaling policy for comparison
Write an AWS CLI command to create a target tracking scaling policy named MyTargetTrackingPolicy for the Auto Scaling group MyAutoScalingGroup. Set the target value to 50 percent CPU utilization.
AWS
Hint
Use aws autoscaling put-scaling-policy with --policy-type TargetTrackingScaling and specify --target-tracking-configuration JSON with CPU utilization metric and target value.
4
Verify the Auto Scaling group has predictive scaling enabled
Write an AWS CLI command to describe the scaling policies for MyAutoScalingGroup and confirm that MyPredictiveScalingPolicy exists with type PredictiveScaling.
AWS
Hint
Use aws autoscaling describe-policies with the Auto Scaling group name to list all policies.
Practice
(1/5)
1. What is the main purpose of AWS Predictive Scaling?
easy
A. To prepare servers ahead of traffic changes using machine learning
B. To manually add servers when traffic increases
C. To reduce server count only after traffic drops
D. To monitor server health without changing capacity
Solution
Step 1: Understand Predictive Scaling's goal
Predictive Scaling uses machine learning to forecast traffic and adjust server capacity before changes happen.
Step 2: Compare options to this goal
Only To prepare servers ahead of traffic changes using machine learning describes preparing servers ahead of traffic changes using machine learning.
Final Answer:
To prepare servers ahead of traffic changes using machine learning -> Option A
Quick Check:
Predictive Scaling = Prepare servers ahead [OK]
Hint: Predictive means it acts before traffic changes [OK]
Common Mistakes:
Thinking it reacts only after traffic changes
Confusing manual scaling with predictive scaling
Believing it only monitors without scaling
2. Which AWS service feature enables Predictive Scaling?
easy
A. Server health monitoring
B. Manual server adjustment
C. Static server allocation
D. Machine learning forecasting
Solution
Step 1: Identify the technology behind Predictive Scaling
Predictive Scaling uses machine learning to forecast future traffic and adjust capacity.
Step 2: Match options to this technology
Only Machine learning forecasting mentions machine learning forecasting, which is the key feature.
Final Answer:
Machine learning forecasting -> Option D
Quick Check:
Predictive Scaling uses machine learning [OK]
Hint: Look for machine learning in options [OK]
Common Mistakes:
Choosing manual or static options
Confusing monitoring with forecasting
Ignoring the predictive aspect
3. Given a sudden traffic spike predicted at 3 PM, what will Predictive Scaling do?
medium
A. Add servers after 3 PM when traffic spikes
B. Increase server capacity before 3 PM to handle traffic
C. Remove servers before 3 PM to save costs
D. Keep server count constant regardless of traffic
Solution
Step 1: Understand timing of scaling actions
Predictive Scaling acts before traffic changes to prepare resources.
Step 2: Analyze options for timing and action
Only Increase server capacity before 3 PM to handle traffic describes increasing capacity before the predicted spike.
Final Answer:
Increase server capacity before 3 PM to handle traffic -> Option B
Quick Check:
Predictive Scaling acts before spikes [OK]
Hint: Predictive means before event, not after [OK]
Common Mistakes:
Choosing to add servers after spike
Thinking it reduces servers before traffic
Assuming no change in server count
4. You configured Predictive Scaling but notice servers are not added before traffic spikes. What is a likely cause?
medium
A. Predictive Scaling is disabled or misconfigured
B. Traffic never changes in your app
C. Manual scaling overrides predictive scaling
D. Server health checks are failing
Solution
Step 1: Identify why predictive scaling might not act
If servers are not added before spikes, predictive scaling may be off or set up incorrectly.
Step 2: Evaluate other options
Traffic changes and manual scaling do not prevent predictive scaling from working if enabled; health checks affect server health but not scaling triggers.
Final Answer:
Predictive Scaling is disabled or misconfigured -> Option A
Quick Check:
Misconfiguration stops predictive scaling [OK]
Hint: Check if predictive scaling is enabled first [OK]
Common Mistakes:
Blaming traffic patterns
Ignoring configuration settings
Confusing health checks with scaling triggers
5. How does Predictive Scaling help balance cost and performance in AWS?
hard
A. By adding servers only after traffic increases to avoid waste
B. By permanently running maximum servers to handle any traffic
C. By forecasting traffic and adjusting capacity before changes to keep apps fast and save money
D. By disabling scaling during low traffic periods
Solution
Step 1: Understand cost and performance goals
Good scaling keeps apps fast and avoids paying for unused servers.
Step 2: Match Predictive Scaling behavior
It forecasts traffic and adjusts capacity before changes, balancing speed and cost.
Step 3: Evaluate options
Only By forecasting traffic and adjusting capacity before changes to keep apps fast and save money describes forecasting and proactive adjustment to balance cost and performance.
Final Answer:
By forecasting traffic and adjusting capacity before changes to keep apps fast and save money -> Option C
Quick Check:
Forecasting balances cost and speed [OK]
Hint: Forecast first, then scale to save money and stay fast [OK]
Common Mistakes:
Thinking scaling happens only after traffic rises
Assuming always max servers run
Believing scaling disables during low traffic
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.