aws / elastic-beanstalk-roadmap

AWS Elastic Beanstalk roadmap
https://aws.amazon.com/elasticbeanstalk/
Creative Commons Attribution Share Alike 4.0 International
283 stars 11 forks source link

Namespace available for "Spot Allocation Strategy" #36

Open scanianick opened 4 years ago

scanianick commented 4 years ago

Community Note

Tell us about your request What do you want us to build? Namespace available for "Spot Allocation Strategy".

Is this request specific to an Elastic Beanstalk platform? If so, which one(s)? No

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? What outcome are you trying to achieve, ultimately, and why is it hard/impossible to do right now? What is the impact of not having this problem solved? The more details you can provide, the better we'll be able to understand and solve the problem.

It would be great to have support for "Spot Allocation Strategy" for the ASG namespace.

Are you currently working around this issue? How are you currently solving this problem? Just selecting one instance type for spot instances instead of higher ends as well and fail over to ondemand instead.

Additional context Anything else we should know?

Attachments If you think you might have additional information that you'd like to include via an attachment, please do - we'll take a look. (Remember to remove any personally-identifiable information.)

stefansundin commented 4 years ago

The current way to work around this is to create an ebextension (e.g. .ebextensions/resources.config) with the following contents:

Resources:
  AWSEBAutoScalingGroup:
    Type: "AWS::AutoScaling::AutoScalingGroup"
    Properties:
      MixedInstancesPolicy:
        InstancesDistribution:
          SpotAllocationStrategy: "lowest-price"

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-instancesdistribution.html#cfn-autoscaling-autoscalinggroup-instancesdistribution-spotallocationstrategy

If you try to include this code for an environment that is not using a launch template, then the deployment will fail. So just keep that in mind.

Sekhar-Kutikuppala commented 4 years ago

@scanianick Elastic Beanstalk uses the new capacity-optimized allocation strategy for provisioning Spot instances. I'm curious if you prefer lowest-price to capacity-optimized and any particular requirements to change the allocation strategy?

mksenzov commented 4 years ago

@Sekhar-Kutikuppala yes, there are cases when "lowest-price" is the best strategy, e.g. cases when smallest reasonable instance type is fine, anything below it is too small and you add bigger instances only to be able to get your spot requests serve in time. It happens when you mostly rely on the smallest instance in the given family (g4dn.large could be the one).