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.
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.
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.
- 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.
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.
- Real-time analysis
- Big data
- Geospatial surveys
- Image and media coding
- Scientific computing
- Scalable websites and web crawlers
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
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.
- 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.