All Products
Search
Document Center

Elastic Compute Service:Preemptible instances

Last Updated:Jun 21, 2023

This topic describes the billing principles and billing rules of preemptible instances.

Billing principles

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.

Note
  • 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.

Billing rules

Billing method

Preemptible instances are billed in 1-second increments and paid for on an hourly basis. You pay for preemptible instances after you use them.

Billing formulas

Note
  • 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.

Protection period

Billing formula

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.

  • Billing duration is shorter than or equal to the protection period (1 hour): Total fee = Transaction price × Billing duration.

  • Billing duration is longer than the protection period (1 hour): Total fee = Transaction price + Spot price × Billing duration after the protection period.

Note
  • Transaction price: the market price at the time of purchase.

  • Spot price: the real-time market price, which varies based on supply and demand.

  • Billing duration: the usage duration of the preemptible instance. This duration lasts from the time when the instance is created to the time when the instance is released.

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.

Billing examples

  • Scenario

    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.

    A case in the International site
  • Billing

    Note

    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.

References