Elastic Algorithm Service (EAS) provides public resource groups and exclusive resource groups. When you use a public resource group to deploy a service to EAS, you can specify preemptible instances for the service to reduce costs. This topic describes how to specify preemptible instances for an EAS service.
Background information
Preemptible instances
Compared with standard instances, preemptible instances have lower costs. You can specify preemptible instances when you deploy a service to EAS to reduce costs. To specify preemptible instances, you must specify your highest bidding price to compete for the instances. For more information about preemptible instances, see What are preemptible instances?
Preemptible instances are more cost-effective than pay-as-you-go instances of the public resource group. The prices of preemptible instances fluctuate in real time based on the changes in supply and demand. You can configure a protection period for preemptible instances. Compared with instances without a protection period, instances with a protection period have higher costs. The following section provides the prices of instances in ascending order:
preemptible instances without a protection period < preemptible instances with a protection period < standard instances
NotePreemptible instances may be released when the market price or stock changes. If a preemptible instance of a service is released, EAS scans the instance types configured for the service in the configuration file and selects the type with the highest priority to create another instance.
How to create preemptible instances
When you deploy a service, you can specify whether to use preemptible instances for the service and specify the highest bidding price for preemptible instances in the service configuration file. Then, the system bids for preemptible instances based on the service configuration file.
If you want to create preemptible instances, the following requirements must be met:
The resources required to create the preemptible instances are sufficient.
The highest bidding price is greater than or equal to the market price of the preemptible instances.
Usage notes for preemptible instances
By default, a new preemptible instance provides services for at least 1 hour. Therefore, the instance has a 1-hour protection period. During the protection period, the system ensures your access to the instance.
After the 1-hour protection period ends, you can continue to use the instance when the resources required to create the instance are sufficient and the previous bidding price that you specify is greater than or equal to the market price of the instance.
If the preceding requirements are not met, your instance may be released after the protection period ends.
Releasing preemptible instances
A preemptible instance is released when the 1-hour protection period ends and the resources required to create the instance are insufficient.
A preemptible instance is released when the 1-hour protection period ends and your previous bidding price is less than the market price of the instance.
A preemptible instance is released when the instance does not have a protection period and the resources required to create the instance are insufficient or your previous bidding price is lower than the market price of the instance.
Billing
Preemptible instances are billed based on the pay-as-you-go billing method. You are charged based on the market price.
Order in which preemptible instances are used
When you create or update a service by using a service configuration file, you can specify multiple instance types in the file, including preemptible instance types and standard instance types. The system selects the first instance type to create or update the service. If the bidding price that you specify is less than the market price of the instance type or if the resources required to create instances of the instance type are insufficient, the second instance type is used.
Prerequisites
If you use a client to specify preemptible instances, make sure that the EASCMD client is installed and identity authentication is complete. For more information, see Download the EASCMD client and complete identity authentication.
Specify preemptible instances when you create a service
Specify preemptible instances when you modify the settings of a service
References
For more information about the advanced configurations for service deployment, see Advanced configurations.
For more information about public resource groups, see Overview of EAS resource groups.