EmpireJones
EmpireJones

Reputation: 3086

AWS EC2 Spot Instances fit for edge services?

Spot instances can randomly get shut down by Amazon. Does this mean that they would not work well as edge services (e.g. REST services)? Using an Elastic Load Balancer (ELB) plus some persistent EC2 nodes (plus the spot instances), would this work well if the client retried a few times upon failure? Or could they get numerous 404s, even with a few retries?

Upvotes: 0

Views: 53

Answers (2)

Guy
Guy

Reputation: 12891

Spot instances are a bit tricky to grok. On one hand they can give you compute power for a very low price, but on the other hand you might lose these instances with minimal notice.

One thing you can do is to give a "max bid" which represents the risk of losing the instances and not only the price you are willing to pay. Since you are not paying your bid price, but only the market price until the market price is higher than your max bid, most of the times you will pay a lower price than your max bid. For example, if you are bidding 90% of the on-demand (OD) price, you will most likely pay less than (for example, 30% of the on-demand price), on average during a run of a week or a month. You can even consider giving a max bid which is higher than on-demand (up to 4 times OD price), and still on average pay much less than the OD price.

It is best to analyze the spot prices for the last 3 months that are provided by the API, and check the behaviour of the market price for the different instance types and in the different regions and availability zones.

Another option you can consider is running 2 auto scaling groups (ASG). One will try to scale (or heal) your spot based instances, and one that will work with on-demand instances. The latter will be slower to kick in, and will work only if the Spot based group is not available due to higher market prices.

Upvotes: 0

datasage
datasage

Reputation: 19563

You will have a little bit of an impact if you decide to use spot instances in this scenario. The key will be getting the load balancer to recognize that the instance is out of service quickly. Also, not using sticky sessions can reduce the chance that they would get repeated 504 (Gateway timeout) errors.

Upvotes: 1

Related Questions