All Products
Search
Document Center

Elastic Container Instance:Billing of elastic container instances

Last Updated:May 27, 2024

This topic describes the billing rules and examples for computing resources of Elastic Container Instance.

Note

This topic mainly describes the billing rules for computing resources of Elastic Container Instance. If you use image caches, increase the size of 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 vCPU and memory specifications

Billing based on the 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 by Elastic Container Instance, 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. Bills are generated on an hourly basis for the amount of seconds the instance was in use.

Elastic container instances are billed on a pay-as-you-go basis. Bills are generated on an hourly basis for the amount of seconds the instance was in use.

Cost optimization

  • General-purpose 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 (number of vCPUs): USD 0.0000077/second (USD 0.02772/hour)

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

Note
  • The unit price of vCPUs for cost-effective specifications is USD 0.00000424/second (USD 0.015264/hour).

  • The prices that are displayed on the buy page and in bills take precedence.

Prices of an ECS instance type may vary based on the region. 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.

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 examples are provided only for reference. The prices in your bills take precedence.

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 = USD 0.05544

  • Memory: 0.00000096 × 3600 × 4 = USD 0.013824

Billable items in the bill are vCPU and Memory, whose codes are cpu and mem. The following figure shows an 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 USD 0.06/hour for the 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.计费示例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. 计费方式

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 and ECS compute saving plans. ECS compute savings plans can only be applied to the elastic container instances that are created by using specified ECS instance types. 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.