All Products
Search
Document Center

Elastic Container Instance:Specify the number of vCPUs and memory size to create a pod

Last Updated:Apr 01, 2026

When you don't have specific requirements for vGPUs or local disks, specify vCPU count and memory size instead of an Elastic Compute Service (ECS) instance type. ECI automatically selects a matching instance type from multiple candidates, giving you better elasticity and resource availability than locking in a specific instance type.

How it works

  1. Set the vCPU and memory you need — either at the container level (using limits or requests) or at the pod level (using the k8s.aliyun.com/eci-use-specs annotation).

  2. ECI maps your request to a supported specification. If your values don't match a supported combination exactly, the system rounds up to the nearest supported spec.

  3. The pod is created using the resolved specification. Billing is based on that resolved spec.

Example: If you request 7 vCPUs and 13 GiB in the China (Hangzhou) region, ECI creates an instance with 8 vCPUs and 14 GiB.

Supported specifications

The system rounds up your requested vCPU and memory values to the nearest supported combination. If the rounded-up specification differs from what you requested, billing is based on the adjusted specification.

If you don't specify vCPUs or memory, ECI creates the pod with 2 vCPUs and 4 GiB by default.
Each elastic container instance supports only one elastic network interface (ENI).
All specifications include 30 GiB of temporary storage by default.

Specifications available in all regions

vCPUMemory (GiB)Bandwidth (bidirectional, Gbit/s, theoretical upper limit)
0.250.5, 10.08
0.51, 20.08
12, 4, 80.1
21, 2, 4, 8, 161
42, 4, 8, 16, 321.5
84, 8, 16, 32, 642
1212, 24, 48, 962.5
1616, 32, 64, 1283
2424, 48, 96, 1924.5
3232, 64, 128, 2566
5296, 192, 38412.5
64128, 256, 51220

Specifications available in selected regions only

Important
  • These specifications are only available in: China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu), and Singapore. If the region or zone you specify doesn't have available resources for these specs, the pod cannot be created.

  • These specifications cannot be used to create preemptible instances.

vCPUMemory (GiB)Bandwidth (bidirectional, Gbit/s, theoretical upper limit)
26, 10, 12, 141
46, 10, 12, 14, 18, 20, 22, 24, 26, 28, 301.5
66, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, and 481.5
810, 12, 14, 18, 20, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 622.5

Configuration methods

Use one of the following methods to define pod resources. When both container-level parameters and the pod-level annotation are present, the annotation takes precedence.

ScenarioPod specification used
None of limits, requests, or eci-use-specs specified2 vCPUs and 4 GiB (default)
Only limits specifiedSum of limits across all containers
Only requests specifiedSum of requests across all containers
Both limits and requests specifiedSum of limits across all containers (requests is ignored)
Only eci-use-specs specifiedValue of eci-use-specs
limits + eci-use-specs, or requests + eci-use-specsValue of eci-use-specs

Set resources at the container level

This is the standard Kubernetes approach. Specify limits or requests for each container in the pod. ECI sums the values across all containers to determine the pod specification.

Use limits rather than requests when possible — when both are present, ECI uses limits and ignores requests.

To prevent a sidecar container from counting toward the pod's resource total, set an environment variable on it to have ECI ignore it during resource adjustment. For more information, see Ignore specific containers when the system adjusts resources.

The following example uses limits to set vCPU and memory for each container:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: test
  labels:
    app: test
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      name: test
      labels:
        app: nginx
        alibabacloud.com/eci: "true"
    spec:
      containers:
      - name: nginx
        image: registry.cn-shanghai.aliyuncs.com/eci_open/nginx:1.14.2
        ports:
        - containerPort: 80
        resources:
          limits:
            cpu: "500m"      # 0.5 vCPU for the nginx container
            memory: "1024Mi" # 1 GiB for the nginx container
      - name: busybox
        image: registry.cn-shanghai.aliyuncs.com/eci_open/busybox:1.30
        command: ["sleep"]
        args: ["999999"]
        resources:
          limits:
            cpu: "1000m"     # 1 vCPU for the busybox container
            memory: "2048Mi" # 2 GiB for the busybox container

If the sum of resource values across all containers is not supported by ECI, the system adjusts the pod specification and charges you based on the adjusted specification.

Each pod supports up to 20 containers. The combined resource usage of all containers must not exceed the pod-level specification.

Set resources at the pod level

Add the k8s.aliyun.com/eci-use-specs annotation to the pod metadata to define resources for the entire pod at once. ECI then selects from multiple compatible instance types to maximize elasticity.

This approach is useful when:

  • Containers in the pod share resources without fixed individual allocations.

  • Your workload runs in frameworks that inject sidecar containers automatically, such as genomic computing pipelines or Istio service meshes.

To restrict which ECS instance families ECI selects from — for example, to require sixth-generation instance families — add an instance family annotation. For more information, see Specify generations of ECS instance families to create pods.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: test
  labels:
    app: test
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      name: test
      labels:
        app: nginx
        alibabacloud.com/eci: "true"
      annotations:
        k8s.aliyun.com/eci-use-specs: "2-4Gi" # 2 vCPUs and 4 GiB for the pod
    spec:
      containers:
      - name: nginx
        image: registry.cn-shanghai.aliyuncs.com/eci_open/nginx:1.14.2
        ports:
        - containerPort: 80
      - name: busybox
        image: registry.cn-shanghai.aliyuncs.com/eci_open/busybox:1.30
        command: ["sleep"]
        args: ["999999"]
        resources:
          limits:
            cpu: "500m"      # Maximum vCPU for this container
            memory: "1024Mi" # Maximum memory for this container

The eci-use-specs value uses the format {vCPU}-{memory}. For example, 2-4Gi requests 2 vCPUs and 4 GiB of memory. When eci-use-specs is set, container-level limits and requests values are ignored for pod sizing but still apply as in-container resource constraints.

What's next