Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does ELB connection draining apply when spot instances are terminated?

A new AWS ELB feature, connection draining, was recently announced.

http://aws.amazon.com/about-aws/whats-new/2014/03/20/elastic-load-balancing-supports-connection-draining/

Apparently this works with Auto Scaling Groups - instances are drained before being removed, but does that also apply to spot instances that are being terminated by AWS due to a rising spot price?

like image 912
Sudhir Jonathan Avatar asked Apr 06 '14 07:04

Sudhir Jonathan


People also ask

What does a load balancer do when an instance stops?

The load balancer stops routing requests to an instance as soon as it is deregistered. If demand decreases, or you need to service your instances, you can deregister instances from the load balancer.

What is connection draining in elastic load balancer?

To ensure that a Classic Load Balancer stops sending requests to instances that are de-registering or unhealthy, while keeping the existing connections open, use connection draining. This enables the load balancer to complete in-flight requests made to instances that are de-registering or unhealthy.

Is it more cost effective to run a spot instance or an on Demand instance when requests Cannot be interrupted?

Spot instances are up to 90% cheaper than On-Demand instances, which can significantly reduce your EC2 costs. A Spot Price is the hourly rate for a Spot instance. AWS sets the Spot price for each instance type in each availability zone based on the evolving supply and demand for Spot instances.

What is the default setting of connection draining in ELB?

Connection Draining is enabled by default for load balancers that are created using the Console. In order to enable Connection Draining using the AWS Management Console you must use the new version of the EC2 console.


1 Answers

Nothing definitive I could find, but from my reading on this, I think the answer is almost definitely no. Spot instances are different animals than regular instances, and the way the connection draining works you can specify upto 60 minute delay before your connection-drained enabled instance gets terminated when it becomes unhealthy - if AWS was to allow this added layer of safety to spot instances, it would completely up-end the way spot instances are used and how they are positioned.

The trade-off for using spot instances has always been, "you can pay a fraction of the cost, but you risk being terminated at any instant without warning"...if they added an up to 60 minute 'warning' to spot instances, while it would be fantastic from the end-users point of view, I think it would severely eat into AWS's on-demand and reserved instance pricing model and thus they probably won't support this anytime soon (unless forced to by competitive pressure).

EDIT 1/6/2015: now, almost a year later, AWS has indeed added a 'two minute warning' for EC2 spot instance termination. https://aws.amazon.com/blogs/aws/new-ec2-spot-instance-termination-notices/

like image 91
E.J. Brennan Avatar answered Sep 21 '22 13:09

E.J. Brennan