All Products
Search
Document Center

Elastic Compute Service:Spot instances

Last Updated:May 08, 2026

Spot instances are pay-as-you-go ECS instances that use spare compute capacity. The market price for a spot instance fluctuates in real time based on supply and demand, reducing your costs by up to 90% compared to regular pay-as-you-go instances.

Billable items

A spot instance is billed based only on its instance type. The fee does not include other resources such as images, disks, public bandwidth (if you use the pay-by-bandwidth method), or snapshots.

Billing rules

Billing formula

  • Billing duration: The period from when a spot instance is created until it is released.

  • Market price: The price of an instance type. This does not include the price of other resources, such as disks and public bandwidth.

  • Bid price: The maximum price that you are willing to pay for a spot instance.

Note

The bid price is not the actual price that you are charged. You are billed based on the current market price.

Duration setting

1 hour

None

Billing diagram

imageimage

Description

Alibaba Cloud guarantees that the instance is not automatically released within one hour of its creation. After this protected hour, the system continuously compares your bid price with the real-time market price and checks resource inventory to determine whether to retain or reclaim the instance.

The instance has no guaranteed runtime after creation. The system continuously compares your bid price with the real-time market price and checks resource inventory to determine whether to retain or reclaim the instance.

Instance billing price

  • If billing duration ≤ 1 hour: The market price at the time of purchase.

  • If billing duration > 1 hour: The market price for each billing period.

The market price for each billing period.

Billing formula

  • If billing duration ≤ 1 hour: Market price at purchase * Billing duration

  • If billing duration > 1 hour: (Market price at purchase * 1 hour) + Σ(Market price in each period * Billing duration of that period)

Σ(Market price in each period * Billing duration of that period)

Note

For the same instance type, the market price for a spot instance with the duration set to None is typically lower than for an instance set to 1 Hour. This is true regardless of whether the actual runtime exceeds one hour.

Billing cycle

Fees are calculated per second, and a bill is generated hourly.

Billing examples

Note

The market price fluctuates based on supply and demand. The price may change at any time. The following examples are for reference only.

image

Scenario 1: Set usage duration to 1 Hour

At 9:40, you place a bid with a maximum price per instance of USD 3/hour and acquire a spot instance at a market price of USD 2.5/hour. You set the usage duration to 1 Hour. At 11:00, your bid price falls below the market price. You receive an interruption notification, and the instance is released 5 minutes later.

Cost calculation

Note

A spot instance is billed per second based on its actual usage duration. To get the price per second, divide the hourly price by 3,600.

The actual billing duration is 5,100 seconds (from 9:40 to 11:05), which is longer than 1 hour. For the first hour, the price is the market price at the time of purchase (USD 2.5/hour). After the first hour, the price is the real-time market price for each period until the instance is reclaimed. The total cost is calculated as follows:

  • Cost for the first hour = Market price at purchase * Billing duration

    From 9:40 to 10:40 (market price: USD 2.5/hour; duration: 3,600 seconds): (2.5 / 3,600) * 3,600 = USD 2.5.

  • Cost after the first hour = Σ(Market price in each period * Billing duration of that period)

    From 10:40 to 11:00 (market price: USD 3/hour; duration: 1,200 seconds): (3 / 3,600) * 1,200 = USD 1.

    From 11:00 to 11:05 (market price: USD 4/hour; duration: 300 seconds): (4 / 3,600) * 300 = USD 0.33.

Total cost = 2.5 + 1 + 0.33 = USD 3.83.

image

Scenario 2: Set usage duration to None

At 9:40, you use automatic bidding to follow the market price and acquire a spot instance at a market price of USD 2/hour. You set the usage duration to None. At 11:00, you receive an interruption notification due to insufficient inventory, and the instance is released 5 minutes later.

Cost calculation

Note

A spot instance is billed per second based on its actual usage duration. To get the price per second, divide the hourly price by 3,600.

The actual billing duration is 5,100 seconds (from 9:40 to 11:05). The price is the real-time market price for each period. The total cost is calculated as follows:

Total cost = Σ(Market price in each period * Billing duration of that period)

  • From 9:40 to 10:00 (market price: USD 2/hour; duration: 1,200 seconds): (2 / 3,600) * 1,200 = USD 0.67.

  • From 10:00 to 11:00 (market price: USD 2.5/hour; duration: 3,600 seconds): (2.5 / 3,600) * 3,600 = USD 2.5.

  • From 11:00 to 11:05 (market price: USD 3/hour; duration: 300 seconds): (3 / 3,600) * 300 = USD 0.25.

Total cost = 0.67 + 2.5 + 0.25 = USD 3.42.

View bills

For more information, see View bills for spot instances.

Overdue payments

If you have overdue payments in your account, you cannot use spot instances. Overdue payments can cause your ECS instances to stop or even be released. To avoid service disruption, settle any overdue payments as soon as possible.

Related documents