AWS Elastic Load Balancing: Seeing extremely long initial connection time

后端 未结 7 1128
心在旅途
心在旅途 2020-12-15 19:30

For a couple of days, we often see an extremely long initial connection time (15s - 1.3 minutes) to our ELBs when making any request via ssl. Oddly, I was only able to obse

相关标签:
7条回答
  • 2020-12-15 19:55

    I think it is a possible ELB misconfiguration. I had the same problem when I put private subnets to ELB. Fixed it by changing private subnets to public. See https://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-manage-subnets.html

    0 讨论(0)
  • 2020-12-15 19:55

    Just to follow up on @Nikita Ogurtsov's excellent answer; I had the same problem except that it was just one of my subnets that happened to be private and the rest public.

    Even if you think your subnets are public, I recommend you double check the route tables to ensure that they all have a Gateway.

    You can use a single Route Table that has a Gateway for all your LB subnets if this make sense

    VPC/Subnets/(select subnet)/Route Table/Edit

    0 讨论(0)
  • 2020-12-15 19:57

    For me the issue was that the ALB was pointing to an Nginx instance, which had a misconfigured DNS resolver. This meant that Nginx tried to use the resolver, timed out, and then actually started working a bit later.

    Not really super connected with Load Balancer itself, but maybe helps someone figure out the issue in their own setup.

    0 讨论(0)
  • 2020-12-15 19:58

    Check security group too. That was an issue in my case.

    0 讨论(0)
  • 2020-12-15 20:07

    This can be a problem with the elb of amazon. The elb scale the number of instances with the number of request. You should see some pick of requests at those times. Amazon adds some instances in order to fit the load. the instances are reachable during the launch process so your clients get those timeout. it's totally randomness so you should :

    • ping the elb in order to get all the ip used

    • use mtr on all ip found

    • Keep an eye on CloudWatch

    • Find some clues

    0 讨论(0)
  • 2020-12-15 20:07

    For me the issue was that I had an unused "Availability Zone" in my Classic Load Balancer. Once I removed the unhealthy and unused Availability Zone the consistent 20 or 21 second delay in "Initial Connection" dropped to under 50ms.

    Note: You may need to give it time to update. I had my DNS TTL set to 60 seconds so I would see the fix within a minute of removing the unused Availability Zone.

    0 讨论(0)
提交回复
热议问题