Keeping cloud costs low and availability high during Black Friday

 

During Black Friday 2017 there seemed to be a lot of missing capacity in several AWS regions, even for on-demand instances. As such, some AWS users are wary of using EC2 spot instances going into Black Friday. In this post we will  explain how Spot by NetApp can help ensure high availability while fully leveraging spot instances. 

 

 

AWS Auto Scaling Groups and multiple instance types 

Traditional Auto Scaling Groups tend to be locked into a single instance type. If that instance is out of capacity, the group is unable to continue scaling. This is especially problematic during Black Friday as systems might start crashing under the load. 

To  solve this issue, Spot by NetApp’s Elastigroup makes it simple to work with multiple instance types within a single scaling group. During this period we recommend enabling a larger number of non-preferred EC2 spot capacity pools than normally used, for the duration of the holiday. This will enable Elastigroup to not only look for a broader variety of spot instances, but also fall-back onto available on-demand instances in the most affordable markets.  Let’s take a look at how to set it up.  

How to set up your Elastigroup capacity pool 

  1. Pick the relevant Elastigroup. 
  2. On the top right corner, press ‘Actions’ → ‘Edit Configuration’.
    configure EC2 for Black Friday
  3. Under the ‘General’ tab → Advanced, make sure that the ‘Fallback to On-Demand’ checkbox is checked.

    automatic fallback to EC2 on-demand instances
  4. Go to the ‘Compute’ tab and scroll down to ‘Additional Configurations’.
  5. Click the ‘Preferred Spot Types’ window and select all your currently used Instance Types as preferred – this will make sure Elastigroup prioritizes your preferred instances before attempting to utilize any other instance types.

    additional spot instance configurations
  6. After you selected your ‘Preferred Spot Types’, scroll back up to the `Spot Types` table and add as many instance types as your workload can support. Ideally you will end up with something similar to this:
    ec2 spot markets
    Important note: A m5.4xlarge instance spot instance has a comparable price to a m5.xlarge on-demand instance and is less expensive than m5.2xlarge on-demand.
  7. Click ‘Next’ twice to the ‘Review’ tab and then click ‘Update’ to save changes.  

What behavior should I expect? 

Elastigroup will provision instances in the following order, moving to the next step in case no capacity is available: 

  1. Preferred spot instance types 
  2. Non-preferred spot instance types 
  3. On-demand type (the one selected on the top right corner of the ‘Compute’ tab) 
  4. Other selected spot instance types as on-demand instances starting with the least expensive ones and up 

What if I want to have a baseline of on-demand instances prior to Black Friday? 

If you still want to set a baseline of on-demand instances prior to Black Friday to guarantee  capacity, go back to the ‘Edit Configuration’ and under ‘General’ set a number of ‘On-Demand Count’ to have Elastigroup run a fixed baseline of On-Demand Instances. 

setting EC2 spot instance capacity

Specific preparation for containerized workloads running in Ocean 

Spot by NetApp’s Ocean simplifies infrastructure management for Kubernetes and other containerized workloads while reliably leveraging spot instances for rock-bottom pricing.  One aspect of Ocean is its focus on container-driven autoscaling. Ocean will launch the most appropriate instance type depending on your pod/container requirements while also accounting for any native labels, taints, tolerations, network and storage requirements. As a result, Ocean by default will enable several different instance types, sizes and families in your cluster, which in turn opens up many different spot markets for Ocean to use.  

Warm start with Ocean Headroom  

Another consideration for Ocean customers is the use of “headroom”. Headroom ensures that the cluster has the capacity to quickly scale more Pods without waiting for new nodes to be provisioned. Ocean optimally manages the headroom to provide the best possible cost/performance balance. However, headroom may also be manually configured to support any use case. In this case, headroom can be used to over-provision the clusters ahead of Black Friday 

To customize the scaling configuration: 

  1. Navigate to your Ocean cluster 
  2. Click on the Actions button on the top-right side of the screen to open the actions menu 
  3. Choose Customize Scaling 

headroom for immediate node availability

Ocean also allows you to configure a separate headroom on a Virtual Node Group level. When custom headroom units are specified on one Virtual Node Group or more, Ocean will maintain a buffer of spare capacity that matches the constraints defined in that Virtual Node Group (node labels, taints, etc.), in addition to the cluster level headroom units. For example, if the cluster level headroom is configured to maintain 2 headroom units of 2048 MiB and 2000 CPU, and a specific Virtual Node Group is configured to maintain 2 Headroom unit of the same size, that means a total of 4 headroom units will be maintained at all times, 2 of them matching the Virtual Node Group’s constraints. 

Get started with Spot by NetApp so your cloud environment will be highly available for Black Friday at the lowest possible cost.