Unless you have special requirements for resources like GPUs or local disks, we recommend creating an ECI instance by specifying its vCPU and memory. The system then uses various ECS instance types to provision the resources.
Specifications
You can create an ECI instance by specifying the vCPU and memory for the instance or for the containers within the instance. If your specified vCPU and memory do not match a supported ECI specification, the system automatically rounds them up to the nearest supported specification. The adjusted resources will meet or exceed your specifications. For example, if you request 7 vCPUs and 13 GiB of memory when creating an ECI instance in the China (Hangzhou) region, the system provisions an instance with 8 vCPUs and 14 GiB of memory.
ECI supports the following specifications:
-
If you do not specify vCPU and memory, the system creates an ECI instance with 2 vCPUs and 4 GiB of memory by default.
-
ECI instances support only one elastic network interface.
-
The default temporary storage is 30 GiB for all specifications.
Specify container vCPU and memory
An ECI instance supports up to 20 containers. You can define custom vCPU and memory specifications for each container. However, the combined resources of all containers must not exceed the instance's vCPU and memory limits. If the total resources exceed the instance's limits, the system automatically adjusts the specifications and bills you accordingly.
You can set an environment variable for a specific container, such as a sidecar container, to exclude it from resource adjustment. This helps prevent resource waste. For more information, see Configure resource adjustment to ignore specific containers.
OpenAPI
When calling the CreateContainerGroup operation to create an ECI instance, you can use the Container.N.Cpu and Container.N.Memory parameters to specify the vCPU and memory for each container. The following table describes these parameters. For more information, see CreateContainerGroup.
|
Parameter |
Type |
Example |
Description |
|
Container.N.Cpu |
number |
2 |
The number of vCPUs for container N, where N is a value from 1 to 20. |
|
Container.N.Memory |
number |
4 |
The memory size in GiB for container N, where N is a value from 1 to 20. |
Console
When you create an ECI instance in the ECI console, you can set the vCPU and memory for each container in its Advanced Settings. The total vCPU and memory of all containers cannot exceed the vCPU and memory configured for the instance (container group).
In the Container Configuration area, click the tab for the target container, such as container-1, expand the Advanced Settings section for that container, and enter the values for vCPU and memory.
Specify vCPU and memory for an instance
This method provisions resources from a variety of ECS instance types based on the vCPU and memory you specify for the ECI instance. This approach offers better elasticity and resource availability. It also provides the following benefits:
-
Containers within the instance do not require specific vCPU and memory settings or resource limits. This allows them to share the allocated instance resources more flexibly.
-
In use cases like genetic computing and Istio, where the service framework automatically adds sidecar containers to pods, explicitly specifying the ECI instance specifications enables ECI to integrate seamlessly with these frameworks.
Some specifications are not available in the console. If a supported ECI specification cannot be selected in the console, use OpenAPI.
OpenAPI
When calling the CreateContainerGroup operation to create an ECI instance, you can use the Cpu and Memory parameters to specify the vCPU and memory for the instance. The following table describes these parameters. For more information, see CreateContainerGroup.
|
Parameter |
Type |
Example |
Description |
|
Cpu |
number |
2 |
The number of vCPUs for the instance. |
|
Memory |
number |
4 |
The memory size in GiB for the instance. |
Console
When you create an ECI instance in the ECI console, you can select the vCPU and memory for the instance (container group) on the Basic Mode tab of the Container Group Configuration section.