Nâng CaoAWS & Cloud iconAWS & Cloud

Auto-scaling strategies trên AWS là gì? Giải thích Target Tracking, Step Scaling, Scheduled Scaling và Predictive Scaling.

AWS Auto Scaling tự động điều chỉnh số lượng instances/containers/Lambda concurrency dựa trên demand. Auto Scaling Group (ASG) cho EC2 có 4 scaling policies:

(1) Target Tracking Scaling — đơn giản nhất, maintain metric ở target value (vd: giữ CPU ở 50%), ASG tự tính toán scale out/in; phù hợp hầu hết use case:

bash
aws autoscaling put-scaling-policy --policy-type TargetTrackingScaling --target-tracking-configuration file://config.json

(2) Step Scaling — define steps tùy theo alarm breach magnitude (vd: CPU 60-70% → add 1, 70-80% → add 2, >80% → add 4); linh hoạt hơn nhưng cần tuning.

(3) Scheduled Scaling — scale vào thời điểm biết trước (mỗi sáng thứ 2-6 scale up, cuối ngày scale down); tốt khi traffic pattern predictable theo lịch.

(4) Predictive Scaling — ML phân tích historical pattern, dự báo load và pre-scale trước khi traffic đến — tránh lag của reactive scaling; launch instances 5-6 phút trước dự báo tăng.

Cooldown period tránh thrashing (mặc định 300s). Scale-in protection cho instances đang xử lý long-running jobs. ECS Service Auto Scaling tương tự ASG. Lambda Provisioned Concurrency giải quyết cold start cho Lambda. Application Auto Scaling cover ECS, DynamoDB, Aurora, Kinesis, SageMaker. Luôn test scaling behavior với load testing trước production.

Xem toàn bộ AWS & Cloud cùng filter theo level & chủ đề con.

Mở danh sách AWS & Cloud