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

Billing principles

Preemptible instances are a type of on-demand instances that are provided at a discount compared to pay-as-you-go instances. The spot prices of preemptible instances fluctuate with changes in supply and demand. When you create a preemptible instance, you must specify a bidding mode to set a maximum hourly price to bid for the preemptible instance. You can select Use Automatic Bid (SpotAsPriceGo) or Set Maximum Price (SpotWithPriceLimit).

The preemptible instance is created, billed, and released based on the following principles:

  • If your bid is greater than or equal to the spot price and the resources of the instance type are sufficient, the preemptible instance can be created and billed at the spot price.
  • If your bid is less than the spot price and the resources of the instance type are insufficient, the preemptible instance is automatically released.
Note
  • For information about the policies, use scenarios, and limits of preemptible instances, see Preemptible instances.
  • 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 Auto Provisioning.

Billing rules

Billing methods

Preemptible instances are billed by second on a pay-as-you-go basis and paid for hourly. You pay for preemptible instances after you use them.

Billing formulas

Note
  • The spot price refers only to the price of the instance type. It does not include the prices of resources such as disks and public bandwidth.
  • During the protection period of a preemptible instance, the preemptible instance cannot be automatically released regardless of changes in spot price. During this period, you can perform operations on the preemptible instance without having to worry about it being released. 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 spot price at the time of purchase. After the protection period ends, the instance is billed by second 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 spot price at the time of purchase.
  • Spot price: the real-time market price, which fluctuates based on the changes in 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 by second based on the spot price.

Total fee = Spot price × Billing duration with each period.

Billing examples

  • Scenario

    Assume that you placed a bid of USD 2 per hour to purchase a preemptible instance with a protection period at 08:00:00 and that the spot price at 08:00:00 was USD 1.5 per hour. The instance runs normally. After the protection period ends, the instance was released at 10:00:00 because the spot price exceeded your bid.

    Note The spot price varies with changes in 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 the 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 was 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