Temporarily disable ELB health check during backend deployment

15,682

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.

Share:
15,682

Related videos on Youtube

Ryan
Author by

Ryan

Updated on September 18, 2022

Comments

  • Ryan
    Ryan over 1 year

    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?
  • ceejayoz
    ceejayoz over 9 years
    @MikeT Great idea.
  • markwalker_
    markwalker_ about 5 years
    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.