A spot instance is a type of on-demand instance with performance same as regular pay-as-you-go instances. It offers a certain discount compared to pay-as-you-go instances. This helps you lower the cost of instance usage in certain scenarios.
When you purchase a spot instance, you need to set the maximum price. When inventory is sufficient and your bid price is greater than or equal to the spot market price, you can successfully purchase the instance. For detailed information, refer to Purchaseing spot instance. After you successfully purchase a spot instance, the instance launches automatically. Then, you can deploy businesses immediately. During this period, the system checks the instance inventory and compares the spot market price with the bid in real time. Specific situations are as follows:
- When the stock is sufficient and the bid price is greater than or equal to the spot market price, you can continue using the spot instance. After business completion, you can manually release the instance.
- When the inventory is insufficient or the market price exceeds your bid price, a spot instance interruption event is triggered. Meanwhile, the system sends a notification about the upcoming instance release via internal messages, SMS, email, or other channels before the release. At the corresponding time after the notification is sent, the system will automatically release the spot instance.
tip
- For non-GPU instances, the notification about the upcoming instance release is sent 5 minutes in advance; for GPU instances, it is sent 1 hour in advance.
- You can subscribe to event notifications and receive instance release notifications via internal message, SMS, email, or other channels before your spot instance is interrupted.
- Normally, the system starts releasing spot instances from the lowest bid. If multiple spot instances have the same bid price, the release order of the instances is determined randomly.
- You can not change instance type.
- You can not change billing method.
Spot instances are suitable for stateless application scenarios. Examples include stateless web site services, image rendering, big data analysis, offline analysis, and large-scale parallel computing and testing. The greater an application's distributed nature, scalability, and fault tolerance, the more effectively it can use spot instances to reduce costs and boost throughput.
You can deploy the following businesses on spot instances:
- Geospatial survey and analysis
- Image and media encoding
- Elastic and scalable business sites
warning
To avoid impacts on business operations by the interrupt reclamation mechanism, do not use spot instances for long-term workloads or stateful applications with high stability requirements, such as databases. Preserving application state is challenging when a spot instance is released.
- Method 1: Create a snapshot to back up valid data in the volume. For specific operations, refer to Creating a snapshot.
- Method 2: Go to the TOS console to enable TOS service. Then upload files that need to be saved to the bucket. For detailed operations, refer to Uploading files.
Spot instance prices fluctuate in real time with market supply and demand. For specific billing rules, refer to Spot instance.