Accelerate ACS pod startup with ImageCache
Creating an ACS pod with an ImageCache accelerates container image pulling and reduces pod startup time. This topic describes the features, creation, usage, and billing of ImageCache.
How it works
Before running a container, an ACS pod must pull the specified container image. However, factors such as network conditions and container image size often make image pulling the longest step in pod startup. To accelerate instance startup, ACS provides the ImageCache feature. By pre-creating an ImageCache from a container image, you can create ACS pods that use the cache. This avoids or reduces image layer downloads and shortens startup time.
The actual speed improvement depends on factors such as the size of the container image used by the ACS pod and the network connectivity to the image repository.
Each ImageCache can contain one image. An ImageCache with the In Progress status is being built. Once its status changes to Completed, it is ready for use.
The time required to create an ImageCache depends on the container image size and the configured network bandwidth. Creation may time out and fail due to issues such as network connectivity problems, authentication failure, or a non-existent repository or tag.
Billing
ImageCache creation phase
There are no charges for the intermediate resources used during ImageCache creation. The first 20 ImageCaches in each region are free. Beyond that quota, the following charges apply:
ImageCache storage fee = Unit price × ImageCache size × ImageCache lifespan
Unit price: CNY 0.18 per GiB/month.
ImageCache size: The size of the pulled and decompressed container image, in GiB.
ImageCache lifespan: Billing starts after the ImageCache is created and stops after it is deleted.
ImageCache usage phase
This fee covers the acceleration cost for the entire lifecycle of a pod that uses an ImageCache. The billing duration is the same as the pod's runtime.
ImageCache acceleration fee = Unit price × ImageCache size ×
Unit price: CNY 0.00231 per GiB/hour
ImageCache size: The size of the pulled and decompressed container image, in GiB.
Total runtime of all pods: When a pod is launched from an ImageCache, the billed duration covers its entire lifecycle, including image pulling, startup, and execution (the billable duration of the ImageCache acceleration matches that of the pod itself). For example, if three pods are launched using an ImageCache in hour T0, and their individual billable durations are 3,600 seconds, 3,000 seconds, and 600 seconds, the total accelerated duration is 3,600 + 3,000 + 600 = 7,200 seconds.
Considerations
Permissions: Creating an ImageCache creates a Service-Linked Role. Therefore, ensure the RAM user has the
ram:CreateServiceLinkedRolepermission.Quotas and limitations:
After an ImageCache is created, its size is displayed. This value is the total size of the decompressed container image files and the ImageCache index files. ImageCache supports container images with a compressed size of up to 500 GiB.
The default quota for ImageCaches is 200 per region. You can submit a ticket to request a quota increase.
You can create a maximum of 50 ImageCaches concurrently in a single region. Completed ImageCaches do not count towards this limit.
If your ImageCache quota exceeds 10,000, filtering by tag and resource group is ignored when you call the ListImageCaches API. At this scale, do not use tags or resource groups for management.
Scope:
Supported regions: ImageCache is available in China (Beijing), China (Shanghai), China (Hangzhou), China (Ulanqab), China (Shenzhen), China (Hong Kong), and Singapore.
Supported image types for CPU instances:
linux/amd64andwindows/amd64. The default islinux/amd64.Supported GPU models and image types: For GPU compute, ImageCache supports the
G59,G49E, andL20 (GN8IS)instance types, and thelinux/amd64image type. For more information about the GPU models supported by ACS, see Accelerated compute instance families.The ACS console only supports creating
linux/amd64ImageCaches. To create a Windows ImageCache, use the OpenAPI and set the Platform parameter towindows/amd64.
Network connectivity: When using an existing ImageCache, ensure network connectivity between the pod and the image repository.
Pull policy: GPU instances only support
imagePullPolicy: Always.
Create an ImageCache
Console
Log on to the Container Compute Service console. In the left-side navigation pane, choose Image Cache.
On the Image Cache page, click Create in the upper-left corner.
Follow the on-screen instructions to configure the region, ImageCache and Access Credential, and network connectivity, and then confirm.
After you create the ImageCache, you can monitor its progress in Create Event.
Parameter
Description
Example
Region
A region that currently supports ImageCache.
China (Beijing)
Image Cache & Access Credentials
Image Cache Name: Must be 2 to 128 characters in length and can contain lowercase letters, digits, and hyphens (-). It cannot start or end with a hyphen.
Image: Select a target image and version from Container Registry (ACR) Enterprise Edition, ACR Personal Edition, or the Artifact Center.
Access Credentials: Password-free access is automatically enabled for ACR repositories under the same account, so you do not need to enter an access credential. If you are using an image from a repository other than Alibaba Cloud Container Registry (ACR), you must specify the server as the domain name of the image repository and configure the corresponding username and password.
ImageCache Name:
image-cache-*****Image:
egs-registry.cn-hangzhou.cr.aliyuncs.com/egs/vllm:0.9.0.1-pytorch2.7-cu128-20250612
Network Configuration
Select one of the following methods to pull the container image that you want to cache.
Public network:
Bind a NAT Gateway to the VPC and configure an SNAT rule for the selected vSwitch.
Automatically create or use an existing EIP.
An EIP created this way is billed based on actual traffic and is released after the ImageCache is created. For more information about billing, see Billing overview.
VPC (internal network): For best performance, upload the container image to a Container Registry (ACR) Enterprise Edition instance in the same region and pull it by using the internal VPC address.
Self-managed image repository (VPC internal network): If the domain name of your self-managed repository cannot be resolved within the VPC, use the private domain name resolution (PrivateZone) feature of Alibaba Cloud DNS to add an A record for the domain name and set the resolution scope to the VPC where the ImageCache resides. This keeps the domain name reachable.
Configure this based on your actual network environment.
OpenAPI
Use an ImageCache
Pod annotation | Description |
| Enables the ImageCache matching feature for the pod. |
After you enable this feature, the pod automatically matches and uses the optimal ImageCache based on the following criteria:
Image match: The ImageCache image name must exactly match the image specified in the pod.
Creation time: The most recent available ImageCache is preferred.
On the Clusters page, click the name of the target cluster. In the left-side navigation pane, choose Workloads > Pods, and then click Create from YAML.
Use the following YAML to create a pod and add the annotation to enable the ImageCache matching feature.
Ensure that the network configuration and credentials provide access to the specified image repository.
apiVersion: v1 kind: Pod metadata: labels: name: hello-pod name: hello-pod annotations: image.alibabacloud.com/enable-image-cache: "true" spec: containers: - image: egs-registry.cn-hangzhou.cr.aliyuncs.com/egs/vllm:0.9.0.1-pytorch2.7-cu128-20250612 # Replace with your image address. command: ["/bin/sleep", "infinity"] imagePullPolicy: Always name: hello-pod ports: - containerPort: 8080 protocol: TCP resources: {} securityContext: capabilities: {} privileged: false terminationMessagePath: /dev/termination-log dnsPolicy: ClusterFirst restartPolicy: AlwaysAfter the pod is created, click its name to go to the Overview page. When the ImageCache matching feature is enabled, the system automatically adds an annotation with information about the matched ImageCache to the pod.
Function
Parameter
Example
Description
ImageCache hit information
image.alibabacloud.com/matched-image-caches[{"imageCacheId":"imc-*****t15xuii6tz*****","size":30}]The ID and size (in GiB) of the matched ImageCache.