All Products
Search
Document Center

Overview

Last Updated: May 19, 2022

This topic describes billable resources of Elastic Container Instance and how to bill the resources.

Introduction

When you use Elastic Container Instance, you are charged for the following resources:

  • Elastic container instances: You are charged for computing resources on a pay-as-you-go basis. The following billing modes are supported:

    • Billing based on the vCPU and memory specifications

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

  • Image caches: You are charged for creating and using image caches if you use the image cache feature.

  • Other resources:

    • Network: If your elastic container instances need to access other resources over the Internet, you must configure elastic IP addresses (EIPs) or NAT gateways for the elastic container instances. You are charged for the used network resources.

    • Storage: If you need to add temporary storage space to your elastic container instances or persistently store data on your elastic container instances, you can attach disks or mount an Apsara File Storage NAS (NAS) file system to your elastic container instances. You are charged for the storage resources that you consume.

Billing of elastic container instances

Description

Elastic container instances are billed on a pay-as-you-go basis. This allows you to use resources before you pay for them. Bills are accurate to seconds and generated by hour. 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.

Note

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 the available credit (the total balance and payment instruments such as vouchers) within your Alibaba Cloud account is less than the payable amount, your account is deemed to have an overdue payment. This may cause your elastic container instances to be released. When you use Elastic Container Instance, make sure that you have sufficient credit in your account so that your business is not affected by instance releases due to overdue payments.

One of the following billing modes applies based on how you create elastic container instances:

  • Billing based on the vCPU and memory specifications

    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. For more information, see Specify the number of vCPUs and memory size to create an elastic container instance.

    The price for an elastic container instance is calculated based on the following formula: (Number of vCPUs × Unit price of vCPUs + Memory size × Unit price of memory) × Running duration of the elastic container instance.

    The following list provides the unit prices of vCPUs and memory in this mode. The actual information displayed on the instance buy page prevails.

    • Unit price of vCPUs: USD 0.0000077 per second

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

  • Billing based on the ECS instance type

    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. When you create elastic container instances, you can specify ECS instance families based on your business requirements. For example, you can specify the ecs.sn1ne instance family to create elastic container instances that provide enhanced network performance. For more information, see Specify an ECS instance type to create an elastic container instance.

    The price for an elastic container instance is calculated based on the following formula: Unit price of ECS instance types × Running duration of the elastic container instance.

    Note

    In this mode, the price of each ECS instance type may vary based on the region. For more information, see the Pricing tab on the Elastic Compute Service page.

We recommend that you create elastic container instances by specifying vCPU and memory specifications. This way, the system tries instance types from various ECS instance families that have the specified vCPU and memory specifications to create an elastic container instance. This ensures that sufficient resources are available to create the elastic container instances. 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, ecs.sn1ne.large, and ecs.sn1.large to create the elastic container instance based on resource availability.

Notice

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:

  • Example 1: Billed by the vCPU and memory specifications

    Assume that you create an elastic container instance by specifying the 2 vCPUs and 4 GiB memory specifications, the hourly price of the instance is calculated based on the following formula:

    • vCPU: USD 0.0000077 per second × 3,600 seconds ×2 vCPUs = USD 0.05544

    • Memory: USD 0.00000096 per second × 3,600 seconds × 4 GiB = USD 0.013824

    The billable items are vCPU and memory. Example: Billing example 3

  • Example 2: Billed by the ECS instance type

    Assume that you create an elastic container instance in the China (Hangzhou) region by specifying the ecs.c6.large instance type, because the unit price of ecs.c6.large is USD 0.06/hour for the China (Hangzhou) region, the hourly price of the elastic container instance is USD 0.06.

    The billable item of the elastic container instance is instance type. Example: Billing example 4

Note

The preceding price calculations are only for examples. The actual prices on bills prevail.

Optimize usage costs of elastic container instances

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 plan

A discount 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 categorized into general-purpose and ECS compute types. ECS compute savings plans can only be applied to the elastic container instances that are created by using specified ECS instance types. General-purpose savings plans have no limits on ECS instance types.

Reserved Instance

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 instance

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.

Billing of image caches

You can use image caches to accelerate image pulling and reduce the startup time of elastic container instances. For information about how to create and use an image cache, see Overview of the image cache feature.

The billing of image caches involves the creation and use of image caches. The following part describes the details about billable items of image caches:

Note

For automatic image caches, you are charged only for using the caches, not for creating the caches.

  • The price for manually creating an image cache

    • Billing of the temporary elastic container instance and ESSD

      When you create an image cache, the system creates a temporary performance level-1 (PL1) enhanced SSD (ESSD) and a temporary elastic container instance that has 2 vCPUs and 4 GiB memory. The temporary instance and ESSD are used to create the image cache. After the image cache is created, the instance and the ESSD are automatically released and no longer billed.

      The price for the temporary instance and the ESSD are calculated based on the following formula: (2 × Unit price of vCPUs + 4 × Unit price of memory + ESSD capacity × Unit price of ESSDs) × Running duration of the temporary instance. The ESSD capacity is equal to the image cache size. The running duration of the temporary instance increases with the image size.

    • Billing of snapshots

      When you manually create an image cache, the system automatically creates a regular snapshot for an image cache based on the temporary elastic container instance and ESSD. You are charged for the regular snapshot based on its size and usage duration. By default, the pay-as-you-go billing method is used. You can use Object Storage Service (OSS) storage plans and storage capacity units (SCUs) to offset snapshot bills. For more information, see Snapshots.

      Snapshot prices are calculated based on the following formula: Unit price of regular snapshots × Snapshot size × Usage duration of the snapshot. The snapshot size is equal to the image cache size. The usage duration is equal to the retention duration of the image cache.

    • Billing of the instant image cache feature

      If you enable the instant image cache feature when you create an image cache, the system creates a temporary local snapshot. The local snapshot is billed based on its usage number and size.

      The price for the instant image cache feature is calculated based on the following formula: 1 × Unit price of the instant image cache feature per time + Unit price of local snapshots × Size of the local snapshot × Usage duration of the local snapshot. The size of the local snapshot is equal to the image cache size. The usage duration of the local snapshot begins when the snapshot starts being created and ends when the snapshot is automatically deleted. The usage duration increases with the image size.

      Note

      After the local snapshot is created, the system begins to create a regular snapshot. After the regular snapshot is created, the system deletes the local snapshot.

  • The price for using an image cache

    • The price for using a manual image cache

      If you use a manual image cache to create an elastic container instance, the system attaches a pay-as-you-go PL1 ESSD to the elastic container instance when the system creates the instance. The ESSD is generated based on a snapshot of the image cache. The ESSD capacity is equal to the snapshot size. The ESSD is created and released together with the elastic container instance. You are charged for the ESSD and the elastic container instance.

      The price for using a manual image cache is calculated based on the following formula: ESSD capacity × Unit price of ESSDs × Running duration of the elastic container instance.

    • The price for using an automatic image cache

      If you use an automatic image cache that is not greater than 20 GiB to create an elastic container instance, you only need to pay for the elastic container instance. If the image cache that you use is greater than 20 GiB, temporary storage space is created for the elastic container instance. The temporary storage space is billed at the pay-as-you-go price of PL1 ESSDs.

      The price for using an automatic image cache is calculated based on the following formula: Capacity of the temporary storage space × Unit price of PL1 ESSDs × Running duration of the elastic container instance.

Note

Unit prices of ESSDs and image cache snapshots vary based on the region. For more information, see the Elastic Block Storage Pricing tab on the Elastic Compute Service page.

Billing of other resources

You may need to use the network and storage services provided by Alibaba Cloud. The following part describes the billable resources of these services and their billing rules.

  • Networks

    If your elastic container instances need to access other resources over the Internet, you must configure EIPs or NAT gateways for the elastic container instances. You are charged for the used network resources.

    Billable resource

    Description

    References

    EIP

    A public IP address that can be separately purchased and managed. An EIP allows the elastic container instance with which the EIP is associated to access other services over the Internet.

    Billing overview

    NAT gateway

    A gateway that can be separately purchased. After you associate an EIP with a NAT gateway, all the elastic container instances in the VPC that is associated with the NAT gateway can access other services over the Internet.

    Billing overview

  • Storage

    If you need to add temporary storage space to your elastic container instances or persistently store data on your elastic container instances, you can attach disks and mount a NAS file system to your elastic container instances. You are charged for the storage resources that you consume.

    Billable resource

    Description

    References

    Disk

    A block device at the data block level. A disk is similar to a physical device. You can partition and format a disk and create file systems for it.

    Elastic Block Storage devices

    NAS file system

    A scalable and distributed file system that provides shared access.

    Billing of general-purpose NAS file systems

    OSS bucket

    A container that provides a large amount of storage space to store data such as images and videos that are generated from the Internet.

    Overview