Lattency-based routing not working

Ray Chamidullin 20 Reputation points
2024-08-06T06:50:15.3066667+00:00

Hello,

I am configuring Azure Front Door to route traffic to my Azure ContainerApps (one in US, one in Germany). The latency-based routing does not seem to work in my setup. Do I have anything wrong with my setup?

Here is my setup:

  • One endpoint with one route to an origin group that has 2 origins: Azure ContainerApp in US and Azure ContainerApp in Germany.
  • Both origins have priority 1 and weight 1000.
  • Session Affinity is enabled.
  • Health probes are enabled.
  • Load balancing has settings: Sample size = 4, Successful samples required = 3, Latency sensitivity (in milliseconds) = 0

Applications in ContainerApps return x-region header with values "eastus" or "germanywestcentral" depending on the region where they are deployed.

I did the following experiment to test the routing:

  • Call ContainerApp in US - average response time 400 ms
  • Call ContainerApp in Germany - average response time 100 ms
  • Call Front Door endpoint 100 times - 80% of times US instance responded with ~400 ms response time and only 20% of times Germany instance responded with ~100 ms response time

I would expect that majority of calls would route to Germany instance.

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
786 questions
0 comments No comments
{count} votes

Accepted answer
  1. KapilAnanth-MSFT 49,021 Reputation points Microsoft Employee
    2024-08-06T08:01:47.9066667+00:00

    @Ray Chamidullin ,

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    From your verbatim,

    • From your region, you find that,
      • ContainerApp in US has a response time of 400 ms
      • ContainerApp in Germany has a response time of 100 ms
    • So, from the same region, you try to access the AFD which has both of these or Origins
    • And you find that 80% of the requests is being forwarded to ContainerApp in US (one with a higher response time)

    From Traffic routing methods to origin

    The 'closest' origin isn't necessarily closest as measured by geographic distance. Instead, Azure Front Door determines the closest origin by measuring network latency

    • Response time is not same as latency, as health probes may probe a different page than the origin actually serves or health probes may use HEAD Request instead of GET request.
    • You say you made 100 calls, can you increase the sample size and give it a try - say 1000 to 2000 requests?
    • Also, you mentioned accessing the container apps from both AFD and directly have the same latency (400 ms for US and 100 ms for Germany)
      • Is this correct?
      • Introducing the AFD did not improve the response time?

    Cheers,

    Kapil


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.