4

We are using ELB for SSL termination, with only ONE backend.

During deployment, the backend need to be restarted and it usually take several minutes to boot up.

My questions:

  • As I only have one backend, so I cannot remove it from ELB, I just want to turn off ELB health check so traffic still go to the backend immediately when server restarted, is it possible?

3 Answers 3

6

You should either shorten or hugely lengthen the check times.

You can set your health check as high as once every 5 minutes, and the unhealthy threshold to 10. This would give you 50 minutes before an instance would be seen as unavailable.

You could also set it down to the minimum of 0.1 minutes and the threshold to 2, which would detect your server being back up in as few as 12 seconds once the health check URL is functioning again. This doesn't keep the ELB from flagging the instance as unhealthy, but it does allow it to come back up as quickly as possible.

I'd go with the second option, so users get a 503 rather than just sitting around wondering why the site is taking so long to load.

3
  • 1
    building on this, you could also fire up a micro or small instance that serves up a simple "we'll be right back" html page and add it to the load balancer. for this method, I would also use the short check times. just remember to take it out of the load balancer once your backend is back up!
    – Mike T
    Jan 2, 2015 at 15:07
  • @MikeT Great idea.
    – ceejayoz
    Jan 2, 2015 at 15:07
  • I'm currently looking for a solution to health checks while in "maintenance mode" on an elasticbeanstalk environment. This mode forces 503 to normal traffic which makes the instances become unhealthy & makes a health check every 5 mins a better option. But to totally disable health checks for a period of time would be perfect. May 17, 2019 at 13:53
0

Another quick way, change the ping port in health check to others, for example, the original port is 443, change it to any un-listen port 1234. it goes to outofservice quickly.

After you did your change, confirmed, then remember to change it back.

0

A legit way around this is to use the API to change the ELB healthcheck timeouts. You can't disable or suspend it but you can change the path OR the timeout and interval.

If you are using Ansible you can use a task before and after deployment.

Here are modules to do this for an ELB and ALB (via Target Groups):

https://docs.ansible.com/ansible/latest/modules/ec2_elb_lb_module.html https://docs.ansible.com/ansible/latest/modules/elb_target_group_module.html

This answer needs examples, I'll update with ours if we go this route.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .