Preemptible instances are a type of on-demand instances that are offered at a discounted price compared to pay-as-you-go instances. Preemptible instances are designed to minimize Elastic Compute Service (ECS) instance costs in specific scenarios.

Introduction

The following table describes the features of preemptible instances.
Feature Description
Bidding mode The market price of a preemptible instance fluctuates based on changes in supply and demand for the instance type. When you create a preemptible instance, you must set a maximum hourly price to bid for a specified instance type. If your bid price is higher than the market price at purchase and the stock of the instance type is sufficient, a preemptible instance can be created.

After a preemptible instance is created, it can be used in the same manner as a pay-as-you-go instance. You can also use it with other cloud resources such as disks or elastic IP addresses (EIPs).

Protection period By default, each preemptible instance is created with a protection period of 1 hour. You can also configure a preemptible instance to not have a protection period when you create the instance.
  • During the protection period of a preemptible instance, the preemptible instance is not released by the system regardless of the fluctuations in market price. You can continue to perform operations on the preemptible instance.
  • Preemptible instances without a protection period are more cost-effective and have a discount of about 10% off compared with preemptible instances with a protection period.
Recycling After the protection period ends, the system checks the market price and resource stock of the instance type every 5 minutes. If the market price is higher than your bid price or if the stock of the instance type is insufficient, the preemptible instance is released.
Notice After an instance is released, its data cannot be recovered. We recommend that you create a snapshot for the instance to back up its data before the instance is released. For more information, see Snapshot overview.

Regardless of whether you attempt to create preemptible instances with or without a protection period, you can check the release rate of each instance type on the instance buy page in the ECS console. The release rate of each instance type is determined by the bidding policy and the supply-demand relationships of resources. A lower release rate indicates that preemptible instances are less likely to be recycled.

In this example, the following instances are of the ecs.c5.8xlarge instance type and reside in Silicon Valley Zone B:
  • The price of a pay-as-you-go instance is USD 1.52/hour.
  • A preemptible instance with a protection period of 1 hour has a discount of 90% off compared with a pay-as-you-go instance of the same type. The price of the preemptible instance is USD 0.152/hour.
If the protection period feature is disabled when the preemptible instance is created, the price of the instance is discounted an additional 10%. As a result, the price for the instance is 0.152 × 0.9 = USD 0.137/hour.
Note The original price of pay-as-you-go instances and the discount for preemptible instances are subject to changes. Prices in this example are for reference only.
spot-price-example-intl

Lifecycle

The following figure shows the lifecycle of a preemptible instance that has a protection period of 1 hour.

After a preemptible instance is created, you can release the instance at any time. When the market price exceeds your bid price or when the stock of the instance type is insufficient, your instance enters the To Be Released state. After 5 minutes, the instance is automatically released. You can check whether the instance enters the To Be Released state based on the instance metadata or the OperationLocks value returned by the DescribeInstances operation.

You can check whether your preemptible instance enters the To Be Released state and store a small amount of data while you wait for the release of the instance. However, to make sure that the application runs normally after your preemptible instance is released, we recommend that you optimize the application design. You can manually release your preemptible instance to check whether the application runs normally after the preemptible instance is released.

Typically, the system first releases the instance that has the lowest bid price. If multiple preemptible instances have the same bid price, the system randomly determines the order in which the instances are released.

Limits

  • Whether you can create a preemptible instance is determined by your ECS instance resource usage. If the Preemptible Instance option is not available for the Billing Method parameter when you create an instance, you cannot create a preemptible instance.
  • Preemptible instances cannot be converted to subscription instances.
  • The instance types of preemptible instances cannot be changed.

Scenarios

Preemptible instances are ideal for stateless scenarios such as scalable web services, image rendering, big data analytics, and large-scale parallel computing. Preemptible instances can be applied to applications that require a high level of distribution, scalability, and fault tolerance capabilities. Preemptible instances help reduce costs and increase the throughput of these applications.

You can use preemptible instances in the following scenarios:
  • Real-time analytics
  • Big data
  • Geological surveys
  • Image and media coding
  • Scientific computing
  • Scalable websites and web crawlers
  • Tests

Preemptible instances are not suitable for stateful applications such as databases. When a preemptible instance is released due to a failed bid or other reasons, application status data cannot be stored.

Pricing and billing

  • Prices
    The price of a preemptible instance covers only the price of the instance type (including vCPUs and memory) and does not include the prices of resources such as the system disk, data disks, and network bandwidth.
    • System disks and data disks are billed on a pay-as-you-go basis. For more information, see Pay-as-you-go.
    • Network bandwidth is billed based on the billing rule for network usage of pay-as-you-go instances. For more information, see Public bandwidth.
  • Market prices

    The market price of a preemptible instance fluctuates based on changes in supply and demand for the instance type. If your bid price is higher than the market price at purchase and the stock of the instance type is sufficient, a preemptible instance can be created.

    If the protection period feature is enabled for a preemptible instance, the instance is billed based on the market price at the time of purchase. After 1 hour, the instance is billed based on the real-time market price.

    We recommend that you evaluate the fluctuations in market price to minimize computing costs and increase throughput when you purchase preemptible instances.

  • Billing methods

    Preemptible instances are billed by second. The market price of a preemptible instance is an hourly price. You can divide the hourly price by 3,600 to obtain the price per second.

    The fees for a preemptible instance from creation to release are accurate to two decimal places. Accrued fees of less than USD 0.01 are not charged.

  • Billing duration

    A preemptible instance is billed based on its usage duration, which lasts from the time when the instance is created to that when it is released. If you stop an instance only by calling the StopInstance operation or by using the ECS console, the instance continues to be billed. When a preemptible instance is no longer needed, we recommend that you create snapshots to back up your data and environment and then release the instance. You can purchase new preemptible instances at any time.

References

FAQ

  • To what resources are the prices of preemptible instances applicable?

    The prices of preemptible instances are applicable only to instance types. Other resources such as disks and network bandwidth are billed at the same prices as those of pay-as-you-go instances.

  • Am I notified when my preemptible instances are about to be released?

    Yes, you are notified when your preemptible instances are about to be released. When your preemptible instances are about to be released due to a spot price change or insufficient resources, the instances first enter the To Be Released state and then are automatically released after 5 minutes.

  • Can the instance type of a preemptible instance be changed?

    No, the instance types of preemptible instances cannot be changed.

  • Which is more cost-effective: a preemptible instance with a protection period or a preemptible instance without a protection period?

    Preemptible instances without a protection period are more cost-effective and have a discount of about 10% off compared with preemptible instances with a protection period.

  • Can I convert between preemptible instances with and without a protection period?

    No, you cannot convert between preemptible instances with and without a protection period. By default, each preemptible instance is created with a protection period of 1 hour. The protection period for a preemptible instance can be configured only when the instance is created.

  • Is the release rate of preemptible instances without a protection period higher than that of preemptible instances with a protection period?
    You can check the release rate of each instance type on the instance buy page in the ECS console regardless of whether you attempt to create preemptible instances with or without a protection period. For each instance type, the release rate is determined by the bidding policy and the supply-demand relationships of resources. release-rate

For more information about preemptible instances, see Instance FAQ.