By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Elasticity is the ability of a system to automatically scale resources (compute, storage, or network) up or down in response to demand. You use it to handle variable workloads efficiently, ensuring performance during spikes while minimizing costs during lulls.
Rules that trigger scaling actions: - Metric-based: Scale when CPU > 80% for 5 minutes.- Schedule-based: Scale up before business hours.- Predictive: Use ML to forecast demand (e.g., AWS Auto Scaling).
Distributes traffic across multiple instances to: - Prevent overload on a single server.- Enable zero-downtime deployments.- Example: NGINX, AWS ALB, Kubernetes Ingress.
Ingress
Simple Diagram Description:
[User Requests] → [Load Balancer] → [App Servers (Auto-Scaled)] ↑ [Monitoring (CPU, Latency)] → [Auto-Scaler]
Goal: Deploy a web app that scales from 1 to 3 EC2 instances when CPU > 50%.
t3.micro
bash sudo yum install -y httpd sudo systemctl start httpd sudo systemctl enable httpd
Test: Visit the instance’s public IP in a browser.
Create an Auto Scaling Group (ASG):
Scaling policies:
Add a Load Balancer:
Configure listeners (HTTP:80) and target groups (point to your ASG).
Test Scaling:
bash sudo yum install -y stress stress --cpu 2 --timeout 300
Expected Outcome: - CPU spikes → ASG launches 2 more instances.- Load balancer distributes traffic.- CPU drops → ASG terminates extra instances.
/health
Track these in your auto-scaler: - CPU/Memory: Classic but lagging indicators.- Request latency: Better for user experience.- Custom metrics: E.g., "orders per second" for e-commerce.
Your web app’s CPU usage spikes to 90% for 5 minutes. What’s the best auto-scaling policy to handle this? A) Scale up by 1 instance immediately.B) Scale out by 2 instances if CPU > 80% for 5 minutes.C) Scale up by 50% CPU capacity immediately.D) Terminate 1 instance to reduce load.
Correct Answer: BExplanation: Scaling out (horizontal) is safer for web apps and avoids single points of failure. A 5-minute threshold prevents thrashing.Why the Distractors Are Tempting: - A: Immediate scaling risks over-provisioning.- C: Vertical scaling (up) has limits and downtime.- D: Terminating instances worsens the problem.
You’re running a stateful database in an auto-scaling group. What’s the biggest risk? A) High latency due to load balancing.B) Data loss when instances terminate.C) Increased costs from over-provisioning.D) Difficulty monitoring database metrics.
Correct Answer: BExplanation: Stateful systems store data locally, so terminating instances can cause permanent data loss.Why the Distractors Are Tempting: - A: Load balancing can add latency, but it’s not the primary risk.- C: Costs are a concern, but data loss is more critical.- D: Monitoring is a challenge, but not the biggest risk.
Which tool is best for auto-scaling a containerized microservice? A) AWS Auto Scaling Groups B) Kubernetes Horizontal Pod Autoscaler (HPA) C) AWS Lambda D) Terraform
Correct Answer: BExplanation: HPA is built for Kubernetes and scales pods based on CPU/memory or custom metrics.Why the Distractors Are Tempting: - A: ASGs work for EC2, but not containers.- C: Lambda is serverless, not ideal for long-running containers.- D: Terraform is for IaC, not runtime scaling.
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.