ALB causing an additional +150ms latency

0

Hi AWS community 👋

I've set up an Application Load Balancer - ECS stack and noticed the ALB is causing latency issues. Direct requests to the Fargate instance have a latency of ~15ms consistently, but requests to the ALB's DNS or public IP have a latency of ~170ms.

Strangely, measuring the latency with Desktop Safari and all the mobile browsers gives ~15ms, but not with Desktop Chrome, curl or postman (all ~170ms).

Another odd behavior I have observed is that the ALB exhibits a warm-up effect, where the latency even increases to over 2s after some idle time and converges to 170ms after 1~3 requests, but there is no such behavior with the Fargate instance.

Can you help me identify the cause of the latency issue and suggest potential solutions?

Edit: It appears that ALB may not be the cause of the issue, as the ALB log shows that request_processing_time, target_processing_time and response_processing_time are all less than 1ms. What could be the source of the problem? I have no idea. ¯\(°_o)/¯

Chrome (to ALB) >> Chrome

Chrome (to Fargate) >> Chrome

Safari >> Safari

Curl >> Curl

1 個回答
0

The ALB is slower that NLB, because the check's of ALB in OSI layer 7. Example: https://blog.cloudcraft.co/alb-vs-nlb-which-aws-load-balancer-fits-your-needs/

profile picture
已回答 1 年前
  • Nlb can help

  • Hi! I've tried NLB, but the results are almost identical. As I said, when I make a request using Desktop Safari, it's super fast. Additionally, when making a request using mobile browsers, including Safari, Chrome, and Firefox, it's also super fast. The problem only occurs when using Desktop Chrome, Firefox, and with tools such as curl or wget. So, I suspect a network problem, but I'm not sure what the variables are.

  • If problem is not in ALB, maybe disable cache can help. Your print Chrome (to ALB), have a DNS Lookup can affect your performance.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南