Preemptible instances are a type of on-demand instances and are discounted compared to pay-as-you-go instances. After a preemptible instance is created, you are guaranteed a protection period to use the instance. After the period, if the market price is higher than your bid or if the resources of the instance type are insufficient, your instance is automatically released. This topic describes the billing methods and billing rules of preemptible instances.
Billing methods
- The market price of a preemptible instance fluctuates based on changes to the supply and demand for its instance type.
- The billing duration of a preemptible instance is the period when the instance is
in service. This period lasts from the time when the instance is created to the time
when the instance is released.
You continue to be charged for a preemptible instance after it is stopped. 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.
When the market price exceeds your bid or when the resources of the instance are insufficient, your preemptible instance enters the To Be Recycled state. After five minutes, the instance is automatically released.
Billing rules
Preemptible instances are billed by second. The market price of a preemptible instance is an hourly price. To get the price per second, you can divide the hourly price by 3,600. During the protection period after a preemptible instance is created, the instance is billed at the market price at the time of purchase. After the protection period ends, the instance is billed based on the real-time market price.
Billing example
Assume that you purchase a preemptible instance at 8:00 with a bid of USD 2 per hour. After the protection period ends, the instance is released at 10:00 because the market price is higher than your bid. The following table describes how to calculate the fee of the preemptible instance.
Time | Market price (USD/hour) | Billing factor | Total fee (USD) |
---|---|---|---|
8:00 | 1.5 | / | / |
8:30 | 2.5 |
|
1.5 / 60 × 30 = 0.75 |
9:00 | 1.8 |
|
0.75 + 1.5 / 60 × 30 = 1.5 |
9:30 | 1.6 |
|
1.5 + 1.8 / 60 × 30 = 2.4 |
10:00 | 3 |
|
2.4 + 1.6 / 60 × 30 =3.2 |