The Auto Scaling cost optimization feature automatically selects the lowest-priced ECS instance type for your Elastic Container Instance (ECI) scaling groups, reducing costs while maintaining your required specifications.
Background information
ECI scaling groups share common Auto Scaling features with ECS scaling groups, such as event-triggered tasks, lifecycle hooks, rolling updates, and notifications. For more information, see Overview of scaling groups. ECI scaling groups also support unique features, including image cache and cost optimization.
How it works
- ECS instance type matchECS instance type unit price < ECI instance unit priceIf a matching ECS instance type is found with a unit price lower than the standard ECI rate: The scaling group creates the ECI instance using the specified ECS instance type. The new instance is billed at the ECS instance type's price. In this case, cost optimization takes effect.
- ECS instance type mismatchUnit price of ECS instance type ≥ Unit price of ECI instanceIf no matching ECS instance type is found, or if its unit price is higher than or equal to the standard ECI rate: The scaling group creates the ECI instance without specifying an ECS instance type. The created ECI instance is billed based on its vCPU and memory usage. In this case, cost optimization does not take effect.
Benefits of cost optimization
- Applicable to multiple scenarios: For applications with low performance requirements, you can select shared instance types or burstable instances to lower resource costs.
- Cost savings: Creating ECI instances with a specific ECS instance type allows you to apply reserved instances and savings plans for additional savings. For more information, see Cost optimization.
Procedure
- Create an ECI scaling group.
For more information, see Step 1: Create a scaling group.
- Create a scaling configuration for the ECI scaling group.
- Find the target ECI scaling group and click View Details in the Actions column.
- At the top of the page, click the Instance Configuration Sources tab.
- On the Scaling Configuration tab, click Create Scaling Configuration.
- After you complete the basic settings and other configurations, click Confirm Configuration.
This example creates two scaling configurations: one with cost optimization disabled and one with it enabled.
- Scaling configuration with cost optimization disabled: Creates ECI instances that are billed by vCPU and memory usage. For more information, see Create a scaling configuration (ECI instances).
- Scaling configuration with cost optimization enabled: Creates ECI instances by finding the lowest-priced ECS instance type that meets your requirements.
When you configure the basic settings, in the Container Group Configurations section, select Enable Cost Optimization and select an Instance Family Level, for example, Enterprise-level. For more information about other settings, see Create a scaling configuration (ECI instances).
The available instance family levels are described in the following table.Instance family level Description Use cases References Entry-level Consists of shared instance types. This level is cheaper but does not guarantee stable computing performance. Workloads with low average CPU utilization. Shared instance types Enterprise-level Provides stable performance with dedicated resources. Workloads that require high stability. Instance families Credit Entry-level Consists of burstable instances, which use CPU credits to ensure computing performance. Workloads with low average CPU utilization and occasional CPU spikes. Overview of burstable instances
- Review your selected configuration and click Preview.
- Click Enable Configuration.
- Configure scaling rules for the scaling group.
For more information, see Create a scaling rule.Note You can configure scheduled tasks and event-triggered tasks for the scaling group based on your business requirements. For more information, see Create a scheduled task and Create an event-triggered task.
- Enable the scaling group.
For more information, see Enable a scaling group.
Results
The following examples show the scale-out results with and without cost optimization enabled.
- If cost optimization is disabled or does not take effect, Auto Scaling creates ECI instances without specifying an ECS instance type. The instance is in the Running state with a specification of 2 vCPU 4 GiB.
- If cost optimization is enabled and takes effect, Auto Scaling creates ECI instances using a specific ECS instance type. In the ECI console, the Instance Type column displays the ECS instance type, such as
ecs.sn1ne.large, confirming that cost optimization was applied.
Cost comparison
The TradePrice values in this example are for reference only. Actual cost savings may vary based on your configuration.
- With cost optimization disabled, the final price (list price minus discounts) of the created ECI instance is 0.00004085, as indicated by the TradePrice parameter.
- With cost optimization enabled, the final price (list price minus discounts) of the created ECI instance is 0.00003387, as indicated by the TradePrice parameter.
In this example, enabling cost optimization reduces the ECI instance price by approximately 17%.