All Products
Search
Document Center

Elastic Container Instance:Elastic container instances

Last Updated:Nov 07, 2022

This topic describes the billing rules for computing resources of Elastic Container Instance. This topic also provides some billing examples.

Note

This topic mainly describes the billing methods for computing resources of Elastic Container Instance. If you use image caches, add the temporary storage space, or configure an elastic IP address (EIP) when you create an elastic container instance, you are also charged for the use of these resources.

Billing

One of the following billing modes is applied based on how you create elastic container instances.

Billing rule

Billing based on the vCPU and memory specifications

Billing based on the Elastic Compute Service (ECS) instance type

Billing overview

In this mode, you are charged for elastic container instances based on the vCPU and memory specifications that you specify when you create the elastic container instances. If the vCPU and memory specifications that you specify are not supported, the system automatically adjusts the specifications. Then, the system charges you based on the adjusted specifications.

In this mode, you are charged for elastic container instances based on the ECS instance types that you specify when you create the elastic container instances.

For example, if you want to use GPU-accelerated capabilities, you can specify the ecs.gn5i-c4g1.xlarge instance type when you create elastic container instances.

Billing method

Elastic container instances are billed on a pay-as-you-go basis.

Elastic container instances are billed on a pay-as-you-go basis.

Cost optimization

  • General-purpose or elastic saving plans

  • Preemptible instances

  • General-purpose or ECS compute saving plans

  • Reserved instances

  • Preemptible instances

Billing formula

Fees for a single instance = (Number of vCPUs × Unit price of vCPUs + Memory size × Unit price of memory) × Billing duration

Fees for a single instance = Unit price of the ECS instance type × Billing duration

Resource price

  • Unit price of vCPUs:0.0000077 USD/second

  • Unit price of memory (GiB):0.00000096 USD/second

Note

The actual prices of the instances are provided on the buy page.

Prices of an ECS instance type may vary across different regions. For more information, see the ECS pricing page.

Billing duration

The billing duration of an elastic container instance begins when the container image starts being pulled and ends when the instance stops running. When the container image is being pulled, the instance is in the Pending state. When the instance stops running, the instance enters the Succeeded or Failed state. You are not charged for elastic container instances that fail to be created or started. For more information, see Lifecycle of elastic container instances.

References

Specify the number of vCPUs and memory size to create an elastic container instance

Specify an ECS instance type to create an elastic container instance

If you do not require special specifications such as GPUs and local disks, we recommend that you specify the number of vCPUs and memory size to create elastic container instances. This way, the system tries multiple ECS instance types to create elastic container instances to ensure resource provisioning. For example, if you want to create an elastic container instance that has 2 vCPUs and 4 GiB memory, the system tries multiple ECS instance types such as ecs.c6.large, ecs.c5.large, and ecs.sn1ne.large to create the elastic container instance based on resource availability.

Important

Each elastic container instance is billed based on your requested resources instead of the actual vCPU utilization and memory usage. For example, you create an elastic container instance that has 2 vCPUs and 4 GiB memory. The average vCPU utilization of the instance is 20% and the memory usage is 60%. The instance is billed based on the specifications of 2 vCPUs and 4 GiB memory, instead of the vCPU utilization and memory usage.

Billing examples

The billable items of elastic container instances vary based on how you create the instances. The following examples show how to calculate the price of an elastic container instance:

Note

The following example is for reference only. The actual prices in your bill prevail.

Example 1: Billed by the vCPU and memory specifications

An elastic container instance is created based on the following specifications: 2 vCPUs and 4 GiB memory. The hourly price of the instance is calculated based on the following formula:

  • vCPU:0.0000077*3600*2=0.05544 USD

  • Memory:0.00000096*3600*4=0.013824 USD

Billable items in the bill are vCPU and Memory, whose codes are cpu and mem. The following figure shows an example.Billing example 3

Example 2: Billed by the ECS instance type

You create an elastic container instance in the China (Hangzhou) region by specifying the ecs.c6.large instance type.The unit price of ecs.c6.large is USD0.06 /hour for this region, so the hourly price of the instance is USD 0.06 .

The billable item in the bill is Instance Type, whose code is instance_type. The following figure shows an example.Billing example 4

Cost optimization

For different business workloads, you can use a combination of savings plans, reserved instances, and preemptible instances to optimize your instance usage costs. Billing options

The following table describes the billing options.

Billing option

Description

References

Savings plans

A plan that can be used together with pay-as-you-go elastic container instances. Savings plans are suitable for stable services that run 24/7 over a long period of time. Savings plans have a slightly higher cost than reserved instances but are more flexible because savings plans are not limited by regions or instance families.

Prices of savings plans are determined based on the hourly commitment, payment method, and subscription duration. Savings plans offset bills based on the committed sum of consumption.

Note

Savings plans are classified into general-purpose, ECS compute, and elastic saving plans. ECS compute savings plans can only be applied to the elastic container instances that are created by using specified ECS instance types. Elastic saving plans can only be applied to the elastic container instances that are created by using the specified number of vCPUs and memory size. No limits are imposed on general-purpose savings plans.

Reserved instances

A discount coupon that can be used together with pay-as-you-go elastic container instances. Reserved instances are suitable for stable services that run 24/7 over a long period of time and require reserved resources. The cost of a reserved instance is similar to the cost of a subscription ECS instance of the same instance type. You must follow specific rules to use reserved instances.

Prices of reserved instances are determined based on the region, instance type, operating system, payment method, and term. Reserved instances offset bills based on the committed resource consumption amount.

Note

Reserved instances can only be applied to elastic container instances that are created by using specified ECS instance types. Reserved instances can be applied only if they are matched with elastic container instances.

Preemptible instances

A type of on-demand instance that is suitable for job-based computing scenarios that have a short running period. Costs of preemptible instances are significantly lower than costs of pay-as-you-go instances. However, prices of preemptible instances change based on the supply and demand of resources. After the protection period expires, preemptible instances may be released due to insufficient resource inventory or bidding that is lower than the market price.

Note

You can purchase both savings plans and reserved instances. Reserved instances are preferentially used to offset bills.