Preemptible instances are a type of on-demand instance. You can use this type of instances to minimize ECS instance costs in a variety of scenarios.

Introduction

The market price of a preemptible instance fluctuates based on changes to the supply and demand of its instance type. When you create a preemptible instance, you must specify a maximum price per hour to bid for a specific instance type. If your bid is higher than the current market price and the stock of the instance type is sufficient, your instance is created and charged at the current market price. After a preemptible instance is created, it can be used in the same way as a pay-as-you-go instance. You can also use it with other cloud services such as cloud disks or elastic IP address.

A preemptible instance has a protected period of one hour after it is created. During this period, the instance is not released even if your bid is lower than the current market price, which ensures that the instance can run services normally. One hour later, the system checks the market price and the stock of the instance type every five minutes. If the market price is higher than your bid or if the stock of the instance type is insufficient, your preemptible instance is released. For more information about preemptible instances, see Instance FAQ.
Note After an instance is released, its data cannot be recovered. We recommend that you create a snapshot for an instance to back up its data before the instance is released. For more information, see Create a normal snapshot.
The following figure shows the lifecycle of a preemptible instance.

After a preemptible instance is created, you can release the instance at any time. For more information, see Release an instance. When the market price exceeds your bid or when the stock of the instance type is insufficient, your instance will enter the Recycling state. After five minutes, the instance is automatically released. You can check whether the instance enters the Recycling state based on the instance metadata or the OperationLocks information returned by the DescribeInstances operation.

You can check whether your preemptible instance enters the Recycling state and store a small amount of data while you wait for the release of the instance. However, we recommend that you optimize the application design to ensure that the application runs properly after your preemptible instance is released. You can try to manually release your preemptible instance to check whether the application runs properly after the preemptible instance is released.

Typically, the system first releases the instance with 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 purchase a preemptible instance depends on your ECS instance resource usage.
  • Preemptible instances cannot be converted to subscription instances.
  • The instance types of preemptible instances cannot be changed.
  • For information about the quota of preemptible instances, see the "Instance limits" section in Limits.

Scenarios

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

You can use preemptible instances for the following businesses:
  • Real-time analysis
  • Big data
  • Geospatial surveys
  • Image and media coding
  • Scientific computing
  • Scalable websites and web crawlers
  • Tests

Preemptible instances are not suitable for stateful applications such as databases, because when a preemptible instance is released due to a failed bid or other reasons, it is difficult to store application state data.

Pricing and billing

  • Prices
    The price of a preemptible instance covers only the price of the instance type (including vCPUs and memory) and excludes the prices of resources such as system disks, data disks, and network bandwidth.
    • System disks and data disks are charged on a pay-as-you-go basis. For more information, see Pay-as-you-go.
    • Network bandwidth is charged based on the bandwidth billing method of pay-as-you-go instances. For more information, see Billing methods of public bandwidth.
  • Market prices

    The market price of a preemptible instance fluctuates based on changes to the supply and demand of its instance type. When you attempt to create a preemptible instance, the creation is successful if your bid price is higher than the current market price of the specified instance type and the stock of the instance type is sufficient.

    Within the first hour after the instance is created, the instance is charged based on the market price at the time of bidding. After one hour, the instance is charged based on the real-time market price.

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

  • Billing methods

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

    The cost incurred by a preemptible instance from creation to release is accurate to two decimal places. Accrued costs of less than USD 0.01 are not charged.

  • Billing duration

    A preemptible instance is charged based on its actual usage period, which lasts from the creation to the release of the instance. If you stop an instance only by calling the StopInstance operation or by using the ECS console, the instance continues to be charged. When you no longer need a preemptible instance, 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.