This topic describes the billing principles and billing rules of preemptible instances.
Preemptible instances are on-demand instances that are provided at a discount compared to pay-as-you-go instances. The market prices of preemptible instances vary based on supply and demand. When you create a preemptible instance, you must specify a bidding mode to set a maximum hourly price and bid for an instance type. You can select Use Automatic Bid (SpotAsPriceGo) or Set Maximum Price (SpotWithPriceLimit).
A preemptible instance is created, billed, and released based on the following principles:
If your bid is greater than or equal to the market price and the instance type is well-stocked, the preemptible instance can be created and billed at the market price.
If your bid is less than the market price and the instance type is understocked, the preemptible instance is automatically released.
For information about the policies, use scenarios, and limits of preemptible instances, see Overview.
Preemptible instances can reduce overall Elastic Compute Service (ECS) instance costs, but have a risk of being reclaimed. You can use auto provisioning groups to alleviate the instability caused by the reclaiming of preemptible instances. For more information, see Overview.
Preemptible instances are billed in 1-second increments and paid for on an hourly basis. You pay for preemptible instances after you use them.
The market price refers only to the price of the instance type. It does not include the prices of other resources, such as disks and public bandwidth.
During the protection period of a preemptible instance, the preemptible instance is not automatically released regardless of changes in market price, and you can run workloads on the instance with confidence. By default, the protection period is 1 hour.
Preemptible instances with a protection period
During the protection period of a preemptible instance, the instance is billed based on the market price at the time of purchase. After the protection period ends, the instance is billed in 1-second increments based on the spot price.
Preemptible instances without a protection period
After a preemptible instance is created, the instance is billed in 1-second increments based on the spot price.
Total fee = Spot price × Billing duration.
Assume that you placed a bid of USD 2 per hour to purchase a preemptible instance with a 1-hour protection period at 08:00:00 and that the market price at 08:00:00 was USD 1.5 per hour. The instance ran as expected. After the protection period ends, the instance was released at 10:00:00 because the market price exceeded your bid.Note
The market price varies based on supply and demand of instance types. The following figure is provided for illustrative purposes only.
Preemptible instances are billed by second based on usage duration. If an hourly price is displayed, you can divide the price by 3,600 to obtain the price per second.
Total fee = (1.5/3,600) × 60 × 60 + (0.5/3,600) × 30 × 60 + (1/3,600) × 30 × 60 = USD 2.25.
Fee for the protection period of 8:00:00 to 9:00:00 (the transaction price is USD 1.5 per hour and the usage duration is 60 minutes) = (1.5/3,600) × 60 × 60 = USD 1.5.
Fee for the period from 9:00:00 to 9:30:00 (the spot price is USD 0.5 per hour and the usage duration is 30 minutes) = (0.5/3,600) × 30 × 60 = USD 0.25.
Fee for the period from 9:30:00 to 10:00:00 (the spot price is USD 1 per hour and the usage duration is 30 minutes) = (1/3,600) × 30 × 60 = USD 0.5.