Traffic Manager vs Load Balancer in Azure

Photo by Luca Bravo on Unsplash

Traffic Manager vs Load Balancer in Azure

Many people get confused with these two services:

  1. Traffic Manager

  2. Load Balancer

The Traffic Manager is like the agent you find when you enter a Bank who tell you:

  1. Take this QUEUE - you get in, until you reach the end of it.

  2. You're attended by the next available agent. Not by one in specific but by the next available. It's random. Agent is free, he/she raises its hand and says, you're up :

    1. Hello

    2. What's up?

    3. Here's your request served

    4. Goodbye. Get out.

You can think about it this way:

The Traffic Manager is an Individual; The Load Balancer is a Group.

A Test Scenario:

  1. 1 Traffic Manager

  2. 1 Load Balancer

  3. 2 Virtual Machines with IIS

Name

Type

Address Or Alias

w1

IIS VM

w1.cocodrilo.space

w2

IIS VM

w2.cocodrilo.space

tfm.cocodrilo.space

Traffic Manager

CNAME for wwwtfm.trafficmanager.net

nlb

Load Balancer

nlb.cocodrilo.space

Like this:

The Traffic Manager can direct traffic to different regions and it's the first touchpoint of a request. It's also used in redundancy scenarios to provide continuity, so, in this scenario, basically, the number of components would be duplicated. In separate Data Centers or Azure Regions.

The How-To

  1. I set up a couple of VMs with Windows 2012 R2 and the IIS default website configured. In order to use the load Balancer, they have to be in the same Availability set.

  2. Configured the Load Balancer

  3. Setup the Traffic Manager

Load Balancer Configuration

Added the VMs on the Same availability set to the Load Balancer Backend pool. Also, very important you have to allow traffic to port 80 in the Network Security Group otherwise it won't be possible to connect to the endpoint.

The Inbound NAT rule is also part of the configuration. In this test, all incoming traffic on Port 80 will go to an Availability set of 2 VMs. This is called nlb.cocodrilo.space. Remember this, the Load Balancer groups resources.

Another view of the configuration with the IP assigned at provisioning time:

[caption id="" align="aligncenter" width="2352"]

The IP is mapped to nlb.cocodrilo.space[/caption]

Traffic Manager endpoint is to the Load Balancer FQDN > nlb.cocodrilo.space and I also created a CNAME for www.cocodrilo.space which points to the Traffic Manager Azure given a name at provisioning time

This Traffic Manager only has 1 endpoint which is the Load Balancer, and behind it there are 2 VMs:

And how does it look?

2nd time

Obviously you'd have the same service and the site would look exactly the same. This is to show how the service works/behaves.

What if one VMs goes off? Or it's rebooted?

Other Misc Settings

Another thing I tested in this configuration was persistence and that's why I get almost a 100% round robin every time I hit the address, because the setting was No persistence at all.

@soyroberto