Preemptible Instances Are a Great Deal

There’s a great deal I’ve never promoted in public communities: Alibaba Cloud’s preemptible instances are extremely cost-effective.

Long-term Significant Discounts

The headline claim of up to 90% savings is not exaggerated. Popular instance configurations typically receive around 20% of the original price (20% discount), while less common configurations can go as low as 9% of the original price (91% discount).

Popular instances include small-scale entry-level servers like 2c2g and 2c4g, as well as CPU/memory balanced servers like 1:2 (4c8g) and 1:4 (4c16g, 8c32g). These receive slightly smaller discounts.

Less common configurations generally refer to CPU/memory unbalanced servers, such as 1:8 (8c64g) and 1:1 (8c8g). These receive the largest discounts.

Today, I checked the preemptible instances and found that 2c16g is cheaper than 2c8g because one has a 9% discount while the other has a 14% discount, creating an inversion.

Alibaba Cloud’s preemptible instance discount rates are dynamically updated. I’m not sure about their algorithm, but it has definitely saved me around 85% on costs for my use cases.

Prerequisites for Using Preemptible Instances

The key to using preemptible instances is separating CPU/memory from long-term storage. Long-term storage can use detachable cloud disks, OSS, NAS, and databases.

Cloud disks are tied to specific regions, and preemptible instance availability is also strongly related to regions. Therefore, although cloud disks offer the best IO performance as stable storage, they cannot guarantee preemptible instance availability in all regions. I personally recommend using them as a secondary option.

The other three storage options rely on networks. Alibaba Cloud’s internal network communication is free, and although IO latency might be higher, the IO speed is acceptable, though random read/write operations are slower than cloud disks.

OSS is Alibaba Cloud’s object storage, suitable for storing files primarily used for reading and network sharing.

NAS is Alibaba Cloud’s network storage, suitable for storing various types of files with balanced read/write capabilities, though not ideal for public sharing.

Databases are suitable for storing structured data, requiring more computational and memory resources compared to the first three options, resulting in higher costs. Databases themselves are long-term storage and depend on cloud disks. Some database types also rely on memory, such as etcd and redis.

Key Questions

  • Can preemptible instances support long-term operations?

The answer is definitely yes. Null Screen Ad Blocker uses preemptible instances to support long-term operations.

  • How are preemptible instances reclaimed?

You can create preemptible instances with or without a protection period. After the protection period expires, when market prices exceed your bid or supply and demand change, preemptible instances will be automatically released. Please ensure proper data backup.

Preemptible instances have two bidding methods:

First, purchasing a protection duration, which means agreeing to use the instance for X hours, after which release depends on market conditions. There are two release forms: one releases all resources, and the other only releases compute resources while retaining cloud disks, IP addresses, and snapshots. Retained resources will continue to incur charges. Operations teams can migrate services to new ECS instances before the agreed time.

Second, not using a protection period, meaning bidding at the current market price. If reserved resources are tight, even bidding at market price may result in reclamation.

Null Screen Ad Blocker relies on a Kubernetes cluster and uses the second bidding method. This method can save an additional 15% compared to the first method.

  • How to migrate services from preemptible instances?

The core issue is that if Alibaba Cloud decides to release your preemptible instance, they will provide a 5-minute advance notice.

Within these 5 minutes, the following tasks need to be completed:

  1. Identify system notifications indicating the preemptible instance is about to be released
  2. Check preemptible instance inventory
  3. Purchase new preemptible instances
  4. Initialize the server and install required service components
  5. Migrate elastic public IP or DNS resolution
  6. Add the new server to the cluster
  7. Migrate services
  8. Remove the old server from the cluster
  9. Release the old server

As analyzed in this article, using preemptible instances can save over 80% of server costs, but it requires decoupling compute from storage, which demands considerable technical capability. I can provide paid consulting services (1000 yuan/hour) during weekends or late nights to help enterprises achieve this goal. A remote desktop environment is required, along with code repository access permissions and a VS Code development environment with Claude Code (Codex or Cursor). I will quickly analyze the business code architecture and provide a decoupling solution.