Overview

Updated at: 2025-03-25 08:20

Preemptible instances, formerly known as spot instances, are unused Elastic Compute Service (ECS) capacity and have the same performance as ECS instances of other pricing models. The prices of preemptible instances vary based on the supply and demand and can go as low as 10% of the prices of pay-as-you-go instances that have the same configurations. Preemptible instances can be created and used when the resource inventory is sufficient, and be interrupted and reclaimed when the resource inventory is insufficient.

Supported scenarios

Preemptible instances provide cost-effective computing resources for short-term tasks and highly fault-tolerant applications. If you are flexible about when your applications run and if your applications can be interrupted, preemptible instances are a cost-effective choice. Preemptible instances are suitable for business that runs in a stateless manner and is highly tolerant to faults and interruptions, such as:

  • Real-time analytics

  • Big data

  • Geological surveys

  • Image and media coding

  • Scientific computing

  • Scalable websites and web crawlers

  • Testing

  • Other stateless business

Important

Preemptible instances are not suitable for stateful, long-running, or high-stability business, such as database services or continuous operations.

Instance lifecycle

image

To create a preemptible instance, you must place a bid for an instance type. If the bid price is higher than or equal to the market price of the instance type and the resource inventory of the instance type is sufficient, the preemptible instance is created. If you set the Instance Usage Duration parameter, which specifies a protection period, to a value other than None when you create the preemptible instance, the created instance enters the specified protection period during which you can reliably use the instance. After the protection period ends, the interruption and reclamation of the preemptible instance are triggered if the market price exceeds your bid price or the resource inventory of the corresponding instance type is insufficient. Five minutes after the interruption and reclamation are triggered, the instance is released.

Note

Bid price: The bid price is determined by the Highest Price per Instance parameter configured when you create a preemptible instance. The bid price is the highest price that you are willing to pay for a preemptible instance of a specific instance type, not the price based on which you are actually charged for the instance. Valid values of the Highest Price per Instance parameter:

  • Use Automatic Bid: The market price is automatically used as the bid price for a preemptible instance of a specific instance type to ensure that the bid price is always equal to the market price and the instance is never interrupted or reclaimed due to fluctuations in the market price. However, the preemptible instance is still likely to be interrupted and reclaimed if the resource inventory is insufficient.

  • Set Maximum Price: You can specify a maximum price that you are willing to pay for a preemptible instance of a specific instance type. A higher bid price increases your chances of retaining a preemptible instance. If the bid price is lower than the market price or the resource inventory is insufficient, the preemptible instance is interrupted and reclaimed.

Instance Usage Duration

  • 1 Hour: If you set the Instance Usage Duration parameter to 1 Hour when you create a preemptible instance, the instance enters a 1-hour protection period upon creation. During the protection period, the instance is exempt from the check mechanism and is not interrupted or reclaimed.

  • None: If you set the Instance Usage Duration parameter to None when you create a preemptible instance, the instance does not have a protection period. The preemptible instance is subject to the check mechanism and may be interrupted and reclaimed at any time.

Characteristics of preemptible instances

image

Interruption and reclamation

Preemptible instances may be inevitably interrupted and reclaimed. You can configure the Instance Usage Duration and Highest Price per Instance parameters based on your business scenarios to balance instance costs and uptime. You can also configure the Instance Interruption Mode parameter to specify how to handle preemptible instances after the interruption and reclamation of the instances are triggered.

Instance Interruption Mode

  • Release: If you set the Instance Interruption Mode parameter to Release for a preemptible instance, the instance and the following resources are released when the interruption and reclamation of the instance are triggered: computing resources (vCPUs, GPUs, and memory), static public IP address (public IP address that is automatically assigned to the instance), public bandwidth, and cloud disks (system disk and data disks).

  • Stop in Economical Mode: If you set the Instance Interruption Mode parameter to Stop in Economical Mode for a preemptible instance, the instance is stopped in economical mode when the interruption and reclamation of the instance are triggered. After a preemptible instance is stopped in economical mode, the computing resources (vCPUs, GPUs, and memory), static public IP address, and public bandwidth associated with the static public IP address of the instance are reclaimed and no longer billed. The billing for other resources of the preemptible instance continues, such as the cloud disks (system disk and data disks), elastic IP addresses (if any), and snapshots. A preemptible instance that is stopped in economical mode may fail to be restarted due to insufficient resource inventory or fluctuations in the market price.

Note

You cannot modify the Instance Interruption Mode parameter for a preemptible instance after the instance is created.

Suggestions for handling the interruption and reclamation of preemptible instances

  • Retain data. When you purchase a preemptible instance, set the Instance Interruption Mode parameter to Stop in Economical Mode or disable the Release with Instance attribute for the cloud disks (system disk and data disks) attached to the instance. This way, the data of the preemptible instance is retained when the instance is interrupted and reclaimed. For more information, see Retain and restore data for preemptible instances.

  • Detect and respond to preemptible instance interruption events. You can use CloudMonitor to subscribe to preemptible instance interruption events, or call API operations to query information of preemptible instances, such as instance status, to detect the interruption events that occur on the instances. For more information, see Detect and respond to preemptible instance interruption events.

Fluctuations in market prices

Market price: the market price of the instance type, which does not include the prices of other resources, such as disks and public bandwidth.

Note

In the following example, a pay-as-you-go instance and a preemptible instance of the ecs.hfg5.8xlarge instance type that reside in the China (Hangzhou) region are used. The prices are only for reference.

  • The market prices of preemptible instances fluctuate based on the supply and demand.

  • The market prices of preemptible instances of the same instance type in the same region may differ if the instances reside in different zones.

image

Savings of up to 90% off pay-as-you-go pricing

Note

In the following example, a pay-as-you-go instance and a preemptible instance of the ecs.hfg5.8xlarge instance type that reside in the China (Hangzhou) region are used. The prices are only for reference.

  • Preemptible instances cost significantly less than pay-as-you-go instances. The prices of preemptible instances can go as low as 10% of pay-as-you-go prices and cannot exceed the pay-as-you-go prices.

  • A preemptible instance that does not have a protection period is more cost-effective than a preemptible instance that has a 1-hour protection period, even after the initial hour of operation.

image

Create a preemptible instance

You can create a preemptible instance in the Elastic Compute Service (ECS) console, by calling an API operation, or by using Terraform. For more information, see Create a preemptible instance.

Limits

  • Whether you can use preemptible instances is determined based on your ECS usage. If you cannot use preemptible instances, the Preemptible Instance option is unavailable when you create ECS instances.

  • Preemptible instances cannot be converted to pay-as-you-go or subscription instances.

  • The instance types of preemptible instances cannot be changed.

  • Preemptible instances do not support Internet Content Provider (ICP) filing.

Billing

Billing rules: For information about the billing of preemptible instances, see Preemptible Instance.

Bills: For information about how to view the bills for preemptible instances, see the Example: View the bills for preemptible ECS instances section of the "View billing details" topic.

Use with other Alibaba Cloud services

To optimize resource management, we recommend that you use preemptible instances with other Alibaba Cloud services: Auto Scaling, Auto Provisioning, and Container Service for Kubernetes (ACK).

FAQ

To obtain answers to frequently asked questions about preemptible instances, see Instance FAQ.

  • On this page (1, M)
  • Supported scenarios
  • Instance lifecycle
  • Characteristics of preemptible instances
  • Interruption and reclamation
  • Fluctuations in market prices
  • Savings of up to 90% off pay-as-you-go pricing
  • Create a preemptible instance
  • Limits
  • Billing
  • Use with other Alibaba Cloud services
  • FAQ
Feedback