Compute Services: ECS, AS, and IMS
ECS essentials
An ECS is defined by flavor, image, disk, VPC/subnet, security group, and EIP. Flavor families include general computing, compute-optimized, memory-optimized, and GPU/accelerated types. Billing modes include yearly/monthly, pay-per-use, and spot, where spot instances use spare capacity at lower cost but can be reclaimed.
Images and Auto Scaling
IMS stores public, private, shared, and market images. A private image captures the OS plus preinstalled software and must match the target ECS architecture. AS combines a scaling configuration (template with image, flavor, disk, and network) with an AS group (desired, minimum, and maximum instances, subnet, and optional load balancer). Policies can be alarm-based, scheduled, or periodic.
Worked example
An AS group has desired 4, minimum 2, and maximum 10 instances. An alarm policy triggers when average CPU exceeds 70% for three consecutive 5-minute periods, adds 2 instances, and uses a 300-second cooldown. If CPU stays at 85%, the first alarm adds 2 instances, bringing the group to 6. During cooldown, further scale-out actions are suppressed, so the group does not jump to 10 immediately. If CPU later falls below 30% for the same period, scale-in removes instances but never below the minimum of 2. Reasoning: the cooldown prevents oscillation, and the maximum caps cost.
Traps
Confusing a scaling configuration with an AS group; using an image whose architecture does not match the flavor; scaling in instances that still hold user sessions; and forgetting that spot instances can be interrupted.