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

Instead of pinning your pod to a specific ECS instance type, specify only the vCPU count and memory size. Elastic Container Instance (ECI) then selects from multiple compatible ECS instance types automatically, giving you better resource availability and elasticity.

How resource sizing works

When you create a pod, ECI maps the requested vCPU and memory to a supported specification. If the exact combination is not available, ECI rounds up to the next supported specification — the result is always greater than or equal to what you requested. For example, requesting 7 vCPUs and 13 GiB produces an instance with 8 vCPUs and 14 GiB.

All specifications include 30 GiB of temporary storage and one elastic network interface (ENI) by default. If no resource configuration is set, ECI creates the pod with 2 vCPUs and 4 GiB of memory.

Supported 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

Available in select regions only

Important

The specifications below are supported only in the following regions: 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 does not have capacity for the requested specification, pod creation fails. These specifications cannot be used for 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, 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

Two methods let you set vCPU and memory for a pod:

MethodSet onUse when
Container limits or requestsPer containerYou need per-container resource control or quotas
k8s.aliyun.com/eci-use-specs annotationPer podContainers share resources freely, or sidecar containers are injected automatically (for example, in Istio or genomics pipelines)

When both methods are configured, eci-use-specs takes precedence. The full priority order is:

ConfigurationPod specification used
None of the parameters set2 vCPUs, 4 GiB
limits onlySum of limits across all containers
requests onlySum of requests across all containers
limits and requestsSum of limits across all containers (requests is ignored)
eci-use-specs onlyValue of eci-use-specs
eci-use-specs with limits or requestsValue of eci-use-specs
If the resulting pod specification is not in the supported list, ECI rounds it up and bills you based on the adjusted specification.

Set resources per container

This is the standard Kubernetes approach. Each container in the pod declares its own resources block, and ECI sums the values across all containers to determine the pod specification. A pod can have up to 20 containers, and the total vCPU and memory specifications of all containers must be lower than or equal to the vCPU and memory specifications of the pod.

Understanding `limits` vs. `requests`

  • `limits`: The maximum CPU or memory a container can use. ECI uses limits to calculate the pod specification. Because limits gives a precise upper bound, use limits whenever possible.

  • `requests`: The minimum amount reserved for the container. When set alone, ECI uses requests to size the pod.

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
          # Combined: 1.5 vCPUs, 3 GiB total -> ECI rounds up to the nearest supported spec
To prevent a specific container (such as a sidecar) from being counted when ECI sizes the pod, set an environment variable on that container to exclude it. For details, see Ignore specific containers when the system adjusts resources.

Set resources for the entire pod

Add the k8s.aliyun.com/eci-use-specs annotation to the pod's metadata section to set vCPU and memory at the pod level. Container-level limits and requests are optional with this method — containers share the pod's resources freely.

This method works well when:

  • Sidecar containers are injected automatically by a service mesh (Istio) or a genomics framework, making per-container sizing impractical.

  • You want to decouple resource allocation from individual container definitions.

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, 4 GiB for the entire 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"       # Optional: cap individual container usage
            memory: "1024Mi"
If you need to restrict which ECS instance families ECI selects from (for example, sixth-generation families only), add a separate annotation to specify instance family generations. For details, see Specify generations of ECS instance families to create pods.

Related topics