All Products
Search
Document Center

Elastic Container Instance:Specify a compute category to create an elastic container instance

Last Updated:Jul 31, 2024

In most scenarios, if you do not require special Elastic Compute Service (ECS) instance types such as GPU-accelerated ECS instance types and ECS instance types with local disks, we recommend that you specify vCPU and memory specifications to create elastic container instances. In this case, you can further specify a compute category. For example, if you want to use a pod that has 0.25 to 8 vCPUs in a simple application scenario, you can set the compute category to economy to reduce the cost. If you want the instance to have one or more vCPUs, you can set the compute category to general to obtain high performance.

Description of the compute category feature

To better meet your requirements for low cost or stable performance, Elastic Container Instance provides the compute category feature. When you create an elastic container instance by specifying vCPU and memory specifications, Elastic Container Instance selects an underlying architecture based on the economy and general compute categories. You can configure a compute category based on your requirements. The system automatically selects an underlying architecture that matches the vCPU and memory specifications.

  • Economy compute category

    The economy compute category supports instances that have 0.25 to 8 vCPUs. The unit price of instances of the economy compute category is lower than the unit price of instances of the general compute category.

  • General compute category

    The general compute category supports instances that have 1 to 64 vCPUs. The specification unit prices of instances of the general compute category are the same as the specification unit prices of instances that are created without the compute category feature enabled. Instances of the general compute category provide higher performance than instances with the same vCPU and memory specifications that are created without the compute category feature enabled.

How to select a compute category

You can select a compute category based on your specific preferences for low cost, stable performance, or high availability. We recommend that you select a compute category based on the following rules:

  • If you want to use the elastic container instance in simple applications, you can select the economy compute category to reduce resource costs.

  • If you want the elastic container instance to provide high performance, you can select the general compute category.

  • If your business can tolerate certain performance fluctuations, you can specify multiple compute categories to prevent instance creation failure due to insufficient resources and ensure high availability.

Description of the compute categories

This section describes the economy and general compute categories supported by Elastic Container Instance.

Note

By default, the temporary storage space of instances of the economy and general compute category is 30 GiB.

Economy compute category

Specifications supported in all regions where Elastic Container Instance is available

vCPU

Memory (GiB)

Baseline bandwidth (bidirectional, Gbit/s)

0.25

0.5 and 1

0.08

0.5

1 and 2

0.08

1

2, 4, and 8

0.08

2

1, 2, 4, 8, and 16

0.2

4

2, 4, 8, 16, and 32

0.4

8

4, 8, 16, 32, and 64

0.8

Specifications supported only in some regions

Important
  • The specifications contained in the following table are supported only in some regions. When you create an elastic container instance that has one of the following specifications, make sure that the corresponding specifications are supported in the specified region and zone. Otherwise, the instance cannot be created because no resources exist in the region and zone.

    The regions that support the specifications contained in the following table include: China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu), and Singapore.

  • You cannot use the specifications in the following table to create preemptible instances.

vCPU

Memory (GiB)

Baseline bandwidth (bidirectional, Gbit/s)

2

6, 10, 12, and 14

0.2

4

6, 10, 12, 14, 18, 20, 22, 24, 26, 28, and 30

0.4

6

6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, and 48

0.8

8

10, 12, 14, 18, 20, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, and 62

0.8

General compute category

Specifications supported in all regions where Elastic Container Instance is available

vCPU

Memory (GiB)

Baseline bandwidth (bidirectional, Gbit/s)

1

2, 4, and 8

1

2

1, 2, 4, 8, and 16

1

4

2, 4, 8, 16, and 32

1.5

8

4, 8, 16, 32, and 64

2

12

12, 24, 48, and 96

2.5

16

16, 32, 64, and 128

3

24

24, 48, 96, and 192

4.5

32

32, 64, 128, and 256

6

52

96, 192, and 384

12.5

64

128, 256, and 512

20

Specifications supported only in some regions

Important
  • The specifications contained in the following table are supported only in some regions. When you create an elastic container instance that has one of the following specifications, make sure that the corresponding specifications are supported in the specified region and zone. Otherwise, the instance cannot be created because no resources exist in the region and zone.

    The regions that support the specifications contained in the following table include: China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu), and Singapore.

  • You cannot use the specifications in the following table to create preemptible instances.

vCPU

Memory (GiB)

Baseline bandwidth (bidirectional, Gbit/s)

2

6, 10, 12, and 14

1

4

6, 10, 12, 14, 18, 20, 22, 24, 26, 28, and 30

1.5

6

6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, and 48

1.5

8

10, 12, 14, 18, 20, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, and 62

2.5

Billing

Important

The economy and general compute categories are in public preview.

  • Economy compute category

    Compared with instances that are created without the compute category feature enabled, instances of the economy compute category are entitled to the same memory unit price and a lower vCPU unit price.

    • Unit price of vCPUs: USD 0.00000424 per vCPU-second (USD 0.015264 per vCPU-hour)

    • Unit price of the memory: USD 0.00000096 per GiB-second (USD 0.003456 per GiB-hour)

  • General compute category

    The specification unit prices of instances of the general compute category are the same as the specification unit prices of elastic container instances that are created without the compute category feature enabled.

    • 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)

Important

After the elastic container instance is created, you can call the DescribeContainerGroups API operation to query the details of the instance. The ComputeCategory response parameter indicates the compute category of the instance. You are charged based on the specification unit prices of the corresponding compute category.

Limits

The following limits apply if you specify a compute category when you create elastic container instances:

  • This feature is valid only when you create elastic container instances by specifying vCPU and memory specifications.

    If you specify ECS instance types when you create elastic container instances, the ECS instance types take precedence. In this case, you cannot specify a compute category.

  • This feature is not supported when you create preemptible elastic container instances.

    If you set the instance category to preemptible and specify a compute category, the system reports an error. The error code is FeatureBasedConstraintConflict.

  • This feature is not supported when you create Arm-based elastic container instances.

    If you set the CPU architecture of the instance to Arm and specify a compute category, the system reports an error. The error code is FeatureBasedConstraintConflict.

Configuration description

When you call the CreateContainerGroup API operation to create an elastic container instance, you can use the ComputeCategory parameter to specify the compute category of the instance in addition to specifying the vCPU and memory specifications of the instance.

You can use one of the following methods to specify the vCPU and memory specifications of the instance:

  • Method 1: Specify vCPU and memory specifications only at the container level. The system automatically adds up the numbers of vCPUs and the memory sizes of all containers to obtain the vCPU and memory specifications of the instance.

  • Method 2: Specify the vCPU and memory specifications at the instance level and configure the vCPU and memory specifications at the container level based on your requirements.

  • Method 3: Specify the vCPU and memory specifications at the instance level by using the InstanceType parameter.

The following table describes the parameters that you can use to specify the vCPU and memory specifications of the instance. For more information, see CreateContainerGroup.

Parameter

Type

Example

Description

Cpu

number

2.0

The number of vCPUs that you want to allocate to the elastic container instance.

Memory

number

4.0

The memory size of the instance. Unit: GiB.

Container.N.Cpu

number

0.5

The number of vCPUs that you want to allocate to container N.

Container.N.Memory

number

1.0

The memory size of container N. Unit: GiB.

InstanceType

String

2-4Gi

The specifications of the instance.

  • You can specify up to five specifications at a time. Separate multiple specifications with commas (,).

  • You can specify vCPU and memory specifications. You can also specify ECS instance types. You can specify the compute category only when you configure the InstanceType parameter as vCPU and memory specifications.

ComputeCategory

string[]

economy

The compute category of the instance. Valid values:

  • economy: economy compute category

  • general: general compute category

You can specify multiple compute categories. The system selects the type for the elastic container instance based on the specified order of the compute categories.

Implementation rules

After you enable the compute category feature, the specifications and compute category of the elastic container instance are determined based on the following rules:

Important

After the elastic container instance is created, you can call the DescribeContainerGroups API operation to query the details of the instance. The ComputeCategory response parameter indicates the compute category of the instance. You are charged based on the specification unit prices of the corresponding compute category.

How you configure the instance during instance creation

Actually created instance

No vCPU and memory specifications are specified, but a compute category is specified.

An instance that has 2 vCPUs and 4 GiB of memory is created. The instance uses the specified compute category.

vCPU and memory specifications and a compute category are specified, and the combination of conditions meets the specification requirements of elastic container instances.

An instance is created based on the specified conditions.

The specified number of vCPUs is less than 1, but the specified compute category is general.

The conditions do not meet the specification requirements of elastic container instances. The system automatically adjusts the number of vCPUs to 1 to meet the requirements of the general compute category.

The specified number of vCPUs is greater than 8, but the specified compute category is economy.

The conditions do not meet the specification requirements of elastic container instances. The system cannot automatically adjust the specification. An error is reported.

vCPU and memory specifications and a compute category are specified. The specified number of vCPUs is within the vCPU specification range of the compute category, but does not meet the specification requirements of elastic container instances.

The system automatically adjusts the specifications of the instance based on the specifications supported by Elastic Container Instance. When the system adjusts the specifications of the instance, the system selects the most similar specifications supported by Elastic Container Instance, and the selected vCPU and memory specifications are higher than or equal to the specified vCPU and memory specifications.

For example, if you set the vCPU and memory specifications to 7-13Gi and the compute category to general, the system automatically adjusts the instance specifications to 8 vCPUs and 16 GiB of memory, which are the most similar specifications that support the general compute category.

Multiple vCPU and memory specifications or multiple compute categories are specified.

The system selects instance specifications based on the following rules:

  • The system creates the elastic container instance based on the specified order of the vCPU and memory specifications or compute categories.

  • Instance specifications have a higher priority than compute categories.

  • The combination of instance specifications and compute categories must meet the specification requirements of elastic container instances.

For example, if you set the vCPU and memory specifications to 4-8Gi,8-16Gi,16-32Gi and the compute categories to general,economy, the system tries to create the instance in the following sequence:

  1. 4-8Gi, general

  2. 4-8Gi, economy

  3. 8-16Gi, general

  4. 8-16Gi, economy

  5. 16-32Gi, general

  6. 16-32Gi, economy (invalid and automatically ignored)

Important

Because instance specifications have a higher priority than compute categories, if multiple compute categories are specified and the specified vCPU and memory specifications do not meet the specification requirements of elastic container instances, the system considers all the compute categories and scales up the instance specifications to the most similar instance specifications. If the intended vCPU and memory specifications are not compatible with a given compute category, this compute category is not considered in the scheduling of the current vCPU and memory specifications.

For example, if you set the vCPU and memory specifications to 0.5-1.9Gi and the compute categories to general,economy, the system adjusts the instance specifications to 0.5-2Gi because the instance specifications of 0.5 vCPU and 2 GiB of memory belong to the economy compute category. However, because the instance specifications of 0.5 vCPU and 2 GiB of memory are not compatible with the general compute category, the scheduling of the current vCPU and memory specifications (0.5-1.9Gi) considers only the 0.5-2Gi instance specifications and the economy compute category.

Sample configurations

  • Example 1: Specify the vCPU and memory specifications of each container and set the compute category to economy.

    ContainerGroupName=test-category
    # Set the compute category to economy.
    ComputeCategory.1=economy
    # Specify the vCPU and memory specifications of each container
    Container.1.Cpu=1.0
    Container.1.Memory=2.0
    Container.1.Name=nginx
    Container.1.Image=registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:1.14.2
  • Example 2: Specify the vCPU and memory specifications of the instance and set the compute categories to general and economy in sequence.

    ContainerGroupName=test-category
    # Specify the vCPU and memory specifications of the instance.
    Cpu=4.0
    Memory=8.0
    # Set the compute categories to general and economy in sequence.
    ComputeCategory.1=general
    ComputeCategory.2=economy
    # Configure the containers.
    Container.1.Name=nginx
    Container.1.Image=registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:1.14.2
  • Example 3: Specify multiple vCPU and memory specifications for the instance and set the compute category to general.

    ContainerGroupName=test-category
    # Specify multiple vCPU and memory specifications for the instance.
    InstanceType=2-4Gi,4-8Gi
    # Set the compute category to general.
    ComputeCategory.1=general
    # Configure the containers.
    Container.1.Name=nginx
    Container.1.Image=registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:1.14.2