AWS Spot Pricing
Use AWS Spot Instances to request spare computing capacity for up to 90% off the On-Demand price. Spot pricing is available for Azure and AWS. GCP has preemptible which is the same process except there is no bid price.
AWS Spot Pricing Overview
A description of spot pricing and information on implementing it.
What is Spot Pricing
Amazon EC2 Spot Instances offer spare compute capacity available in the AWS cloud at steep discounts compared to On-Demand instances. Spot Instances can be interrupted by AWS with two minutes of notification when AWS needs the capacity back. AWS can interrupt your Spot Instance when the Spot price exceeds your maximum price, when the demand for Spot Instances rises, or when the supply of Spot Instances decreases.
The recommendation is to avoid running critical or long running jobs on spot instances as jobs may be killed when spot instances are preempted.
Implementing AWS Spot Pricing
Create an AWS bursting scenario. Once the bursting scenario is created, select the bursting scenario and edit the instance types. A list of machine types are displayed that can be enabled for spot pricing:
- Instance type name
- Name of the instance type (machine type, shapes or flavors) as defined by the cloud provider.
- Core
- Number of CPUs available for this instance type.
- Mem
- Amount of RAM available for this instance type.
- GPU
- Number of GPUs available for this instance type.
- Price
- On-demand price. With On-Demand instances, you pay for compute capacity by per hour or per second depending on which instances you run. No longer-term commitments or upfront payments are needed. You can increase or decrease your compute capacity depending on the demands of your application and only pay the specified per hourly rates for the instance you use.
- Current Spot Price
- Currently, available spot price. With spot instances, you pay the spot price that's in effect for the time period your instances are running. Spot instance prices are set by Amazon EC2 and adjust gradually based on long-term trends in supply and demand for Spot instance capacity. Spot instances allow you to request spare Amazon EC2 computing capacity for up to 90% off the On-Demand price.
- Max Spot Price
- Maximum amount that your site is willing to pay to continue using the spot instance. Once this price is exceeded the spot instance can be interrupted by AWS with two minutes of notification.
- Spot enabled
- Use this checkbox to enable spot pricing for an instance type.
Choose which instance types that you want for spot pricing and enter a maximum price that you are willing to pay to continue using the spot instance.
A scenario must be added to the cloud bursting hook configuration file for every instance type selected for spot pricing and the scenario must be enabled as preemptible.
"preemptable": true
Cloud Bursting Hook Scenario Example
Two instance types are selected for spot pricing:
Add the following scenario to the cloud bursting hook configuration file:
"aws_scenario_1": { "api_key": "API-KEY-HERE", "cloud_default_image": "<CloudDefaultImage>", "cloud_max_instances": 20, "max_nodes_per_burst":50, "cloud_node_wait_timeout":180, "preemptable": true }
Choose Spot Instances
Choose instance types for spot pricing and set the maximum spot price.