All Products
Search
Document Center

Elastic Container Instance:Image caches

Last Updated:Nov 16, 2023

This topic describes the billing rules of image caches and provides billing examples.

Description

You can use image caches to accelerate image pulling and reduce the startup time of elastic container instances. Image caches are classified into manually created image caches and automatically created image caches. The following table describes the billing rules of the different types of image caches.

Operation phase

Manually created image caches

Automatically created image caches

Create an image cache

The resources are perceptible. The following list describes the billable items:

  • Temporary resources (the elastic container instance and the disk that are used to create the image cache)

  • The snapshot

The resources are imperceptible. You are not charged for the resources.

Use the image cache

Billable item: the disk.

If the image cache is greater than 30 GiB in size, you must increase the capacity of the temporary storage space and pay for the additional capacity.

Note

After the image cache is created, you can view the size of the image cache in the creation event information of the image cache. For more information, see Overview of image caches.

Manually created image caches

  • Create an image cache

    Billable item

    Description

    References

    Temporary resources (the elastic container instance and the disk that are used to create the image cache)

    When you manually create an image cache, the system automatically creates a temporary performance level-1 (PL1) enhanced SSD (ESSD), and a temporary elastic container instance that provides 2 vCPUs and 4 GiB memory. The temporary instance and ESSD are used to create the image cache. After the image cache is created, the instance and the ESSD are automatically released. You are no longer charged for the resources.

    • Billing method: pay-as-you-go.

    • Billing formula: Price = (Unit price of vCPUs × 2 + Unit price of memory × 4 + Unit price of disks × Storage capacity of the disk) × The run duration of the instance.

    • Description of the formula:

      • Unit price

      • The storage capacity of the disk: This value is equal to the size of the image cache.

      • The run duration of the instance: The run duration of the instance varies based on the size of the image cache. To create the image cache, the temporary elastic container instance needs to pull an image. The temporary instance requires a longer period of time to pull a larger size of image. As a result, the run duration of the temporary instance is longer if you create a larger size of image cache.

    The snapshot

    When you create an image cache, the system pulls an image to create a temporary elastic container instance, and then creates a regular snapshot based on the temporary instance. The lifecycle of the snapshot is the same as the lifecycle of the image cache. You must pay the snapshot storage fee to retain the image cache.

    Snapshots

  • Use the image cache

    Billable item

    Description

    References

    The disk

    If you use a manually created image cache to create an elastic container instance, the system automatically attaches a pay-as-you-go PL1 ESSD to the instance. If no PL1 ESSD is available, an ultra disk is attached. The storage capacity of the disk is equal to the size of the image cache. The disk is created and released together with the instance. You must pay for the elastic container instance and the disk.

    EBS devices

Automatically created image caches

You can enable automatic match of image caches when you create an elastic container instance. Then, if no image cache is matched, the system automatically creates an image cache while the system creates the elastic container instance.

When you use an automatically created image cache to create an elastic container instance, you may need to pay for the additional capacity of the temporary storage space based on the size of the image cache.

Billable item

Description

Additional capacity of the temporary storage space

If the image cache that you used to create the elastic container instance is greater than 30 GiB in size, you must increase the capacity of the temporary storage space of the elastic container instance. You must pay for the elastic container instance and the additional capacity of the temporary storage space.

Temporary storage space

Billing examples

Note

The following examples are provided only for reference. The actual prices in your bills take precedence.

Example 1: Create and use a manually created image cache

For example, you create an image cache in the China (Hangzhou) region that is 40 GiB in size and retain the cache for 3 days. When you create the image cache, you do not enable the instant image cache feature, and the temporary elastic container instance runs for a duration of 5 minutes (300 seconds). The storage capacity of the snapshot that corresponds to the image cache is 2 GiB.

You are charged for the following resources when you create the image cache:

  • The temporary resource: (0.0000077 × 2 + 0.00000096 × 4 + 0.05/100/3600 × 40) × 300 = USD 0.007449.

  • The snapshot: 0.02/30 × 2 × 3 = USD 0.004.

Total creation price = Temporary resource price + Snapshot price = 0.007449 + 0.004 = USD 0.011449.

If you use the image cache to create an elastic container instance and the instance runs for 3 hours, you are charged for the instance and disk. The disk price is equal to the usage fees of the image cache. Price = 0.05/100 × 40 × 3 = USD 0.06

Example 2: Use an automatically created image cache

For example, you create Elastic Container Instance A in the China (Hangzhou) region. The image that you use to create the instance is not greater than 30 GiB in size. When you create the instance, you enable automatic matching for image caches. If no image cache is matched, the system automatically creates an image cache. You do not need to pay for the automatic creation of the image cache.

If you create Elastic Container Instance B based on the image cache, you need to pay only the instance price.