HTTP API GW + API VPC Link + Cloudmap + Fargate - How does it load balance

0

I am using an infrastructure setup as described in the title. This setup is also somewhat shown in this picture: https://d2908q01vomqb2.cloudfront.net/1b6453892473a467d07372d45eb05abc2031647a/2021/02/04/5-CloudMap-example.png

In the official AWS blog here: https://aws.amazon.com/blogs/compute/configuring-private-integrations-with-amazon-api-gateway-http-apis/ the following is stated about using such setup:

As AWS Cloud Map provides client-side service discovery, you can replace the load balancer with a service registry. Now, connections are routed directly to backend resources, instead of being proxied. This involves fewer components, making deployments safer and with less management, and reducing complexity.

My question is simple: What load balancing algorithm does HTTP API GW use when distributing traffic to resources (the Fargate tasks) registered in a service registry? Is it round-robin just as it is with ALB?

Only thing I was able to find is this:

For integrations with AWS Cloud Map, API Gateway uses DiscoverInstances to identify resources. You can use query parameters to target specific resources. The registered resources' attributes must include IP addresses and ports. API Gateway distributes requests across healthy resources that are returned from DiscoverInstances.

https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-private.html#http-api-develop-integrations-private-Cloud-Map

3 個答案
0
已接受的答案

Ok, So I got official answer from Support team:

For HTTP API -> CloudMap integration, API Gateway service calls "DiscoverInstances" API call. This call returns healthy instances. API Gateway then selects any one of the instances randomly to route the actual request to.


Hence we can understand that traffic distribution differs in HTTP API -> CloudMap integration from that of HTTP API -> Application Load Balancer. Because ALB uses round robin to distribute the traffic, where in the traffic is distributed randomly in case of integration with CloudMap.

simon
已回答 2 年前
profile picture
專家
已審閱 15 天前
0

Hello,

Tim here with the Premium Support Team and I’ve been reading through your notes and checked out the blog post you linked.

If you can could you open a AWS support case with us to further explore this topic? We’d like to understand the use case you have a bit more in depth and possibly gather some ARNs which you can privately share with us then.

Thanks!

AWS
支援工程師
Tim_P
已回答 2 年前
  • Yes, I have reached out to support already.

0

I've found this re:invent 2020 slide which says the traffic gets routed to available services in a round-robin pattern, hope that will be helpful. https://d1.awsstatic.com/events/reinvent/2020/Amazon_API_Gateway_HTTP_APIs_beyond_the_proxy_SVS401.pdf#page=23

已回答 1 年前

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

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

回答問題指南