How to Improve Website Response using Traffic Manager

In this article, I will explain, how to Improve Website Response using Traffic Manager. Use Traffic Manager to create a highly responsive website by directing user traffic to the website with the lowest latency. Generally, the datacenter with the minimum latency is the one that is closest to the geographic distance.

In this article, you learn how to:

Create two virtual network
Create 2 VMs running a basic website on (IIS)
Configure DNS name for the VMs (running IIS)
Create two tests VMs to view Traffic Manager in action
Create a “Traffic Manager profile” for improved website performance
Add VM (Instance) endpoints to the Traffic Manager profile
View Traffic Manager in action

Prerequisites

In the interest of see the Traffic Manager in action, this article requires that you deploy the following:
2 instances (VMs) of basic websites running in different Azure regions – (East US and West Europe).
2 test VMs for testing the Traffic Manager – 1st VM in West Europe and the 2nd VM in East US. The test VM (Instance) is used to represent how Traffic Manager Routes user traffic to the website that is running in the same region as it provides the lowest latency.

Improve Website Response using Traffic Manager

Sign in to the Microsoft Azure portal

Create a virtual network

1- In the search bar type (virtual networks) to find or from the Azure portal menu and then select virtual networks.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

2- In the virtual network, select the add button create a virtual network.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

3- Create virtual network window, choose your subscription. Resource Group, select create new to create.

Enter a resource group name (rg-vnet) and then click ok.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

4- Under the instant details type a virtual network name (vnet01).
Choose a location to use as the basis for your virtual network. Select a location that is near to your location to increase performance. Click on Next: IP Addresses >

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

5- Choose an address space IPv4 address space, I am selecting 10.1.0.0/8, but if you prefer to use a different address feels free. Click + Add subnet

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

6- In the Add subnet wizard, type a subnet name (vnet-subnet) and then type 10.1.0.0/24 for Subnet address range.
To create service endpoint policy to allow traffic then select a service under services.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

7- Click Next : Review + Create >

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

8- Virtual network validation passed, selects Create.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

9- To create a 2nd virtual network follow the above steps from 3 to 6 again with the following changes.

SettingValue
Resources Grouprg-westus
Namevnet-westus
Region(US) west US
IPv4 address space192.168.0.0/16
Subnet namesubnetwestus
Subnet address range192.168.1.0/24
Create 

9- Virtual network overview.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

Create Virtual Machines

Now we need to create VM in each virtual network so that we can communicate between them.

1st VM

1- Azure portal menu tab, select Virtual machines.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

2- Select the + Add button to create virtual machine.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

3- Resource group select existing (rg-eastus).

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

4- Instance details

Enter a virtual machine name (server-eastus)
Region select (East US)
Image selects Windows Server 2019 Datacenter. You can select a different operating system, but the remaining steps presume you selected Windows Server 2019 Datacenter.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

5- Administrator account.

Enter a username (jamil), Password.
Public inbound ports choose allow selected ports.
Select inbound ports (HTTP, RDP) and then click Next : create >

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

6- Under Management tab
Monitoring boot diagnostics (off) and then click Review + create

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

7- Select create

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

Create the second VM

Complete steps 2 to 7 again, with the following changes:-

NameValue
Resource grouprg-westus
Virtual machine nameserver-westus
Region(US) West US
ImageWindows Server 2019 Datacenter
Administrator accountusername password
Public inbound portallow selected ports
Select inbound portsHTTP, RDP
Management tabmonitoring boot diagnostic (off)
Review + create 
Create 

The VMs take a few minutes to create. Now the both VMs (web1, web2) successfully created.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

Configure DNS names for the VMs running IIS

In this section, we will configure the DNS names for the IIS servers – server-eastus and server-westus.

1- Select server-eastus

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

2- Overview page, under DNS name, select Configure.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

3- Select Configuration under settings, under DNS name label (optional), enter a unique name, and then select Save.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

4- Select server-westus.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

5- Overview page, under DNS name, select Configure.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

6- Configuration page, under DNS name label (optional), type a unique name, and then select Save.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

Create Test VMs

In this section, you create a VM (vmtest-eastus and vmtest-westus) in each Azure region (East US and West US). We will use these VMs (Virtual Machines) to test how Traffic Manager routes traffic to the nearest IIS server when we browse to the website.

1- On the upper, left corner of the Azure portal, select Azure menu, and then select virtual machine.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

2- In Create a virtual machine, click on + add button.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

3- In the Basics tab
Select Subscription
Resource Group – Select rg-eastus.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

4- Instance Details

Virtual machine name – Type vmtest-eastus.
Region – Select East US.
Image – Windows Server 2019 Datacenter.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

5- Administrator Account

Username – Enter a user name.
Password – Enter a password.

Public inbound ports – Choose Allow selected ports.
Select inbound ports – Choose HTTP, RDP in the pull down box.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

6- Review the settings, and then click Create.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

Follow the Steps to Create a 2nd VM.

SettingsValue
Resource grouprg-westus
Namevmtest-westus
RegionWest US
ServerWindows server 2019 datacenter
Administrator accountUsername, password
Public Inbound portsHTTP, RDP
Review + create 
create 

The VMs take a few minutes to create. Please do not continue with the remaining steps until all VMs are created.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

Create a Traffic Manager profile

To create a Traffic Manager profile that instructs user traffic by sending them to the endpoint with lowest latency.

1- In the Azure search type traffic manager, select Traffic Manager Profiles.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

2- Traffic Manager profiles, click the + Add.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

3- In the Create Traffic Manager profile wizard
Name – Type a name (trafficmanager33)
Routing method – type Performance
Select Subscriptions
Resource group – select rg-eastus
Select Create

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

4- Traffic Manager profiles.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

Add Traffic Manager Endpoints

Add the two VMs running the IIS servers – server-eastus & server-eastus to route user traffic to the closest endpoint to the user.

1- In the portal’s search bar, search for the Traffic Manager profile and then select it.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

2- In Traffic Manager profile, click on trafficmanager33.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

3- Select Endpoints under settings, and then click + Add.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

4- Add Endpoint

Type – Azure endpoint
Name – eastusendpoint
Target Resource type – Public IP address
Public IP address – server-eastus-ip
Click Add

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

5- Select + add button again for second endpoint.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

6- Add Endpoint

Type – Azure endpoint
Name – westusendpoint
Target Resource type – Public IP address
Public IP address – server-westus-ip
Click Add

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

7- After the addition of both endpoints completed, they will displayed in Traffic Manager Profile together with their monitoring status as Online.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

Test Traffic Manager Profile

Determine DNS name of Traffic Manager Profile

In this step, we use the DNS name of the Traffic Manager profile to visit the websites.

1- In the Azure search bar, search for the Traffic Manager profile name and then select it that we created in the preceding section. select the traffic manager profile.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

Overview

2- Your Traffic Manager profile will display the DNS name of your newly created one.
Copy DNS name

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

Improve Website Response using Traffic Manager

3- Go to the virtual machines and then click vmtest-eastus.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

4- Connect virtual machine (server-eastus), using RDP.

5- Open web browser on the VM (instance) vmtest-eastus, enter the DNS name of the Traffic Manager profile to view the website. Since the VM located in East US, you are routed to the nearest website hosted on the nearest IIS server server-eastus that is located in East US.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager

6- Connect virtual machine (server-westus), using RDP

7- Open web browser on the VM vmtest-westus, type the DNS name of your Traffic Manager profile to view your website. Since the VM located in West US, you are routed to the nearest website hosted on the nearest IIS server server-eastus that is located in West US.

Improve Website Response using Traffic Manager, How to Improve Website Response using Traffic Manager
Jamil Parvez
Jamil Parvezhttps://www.xpertstec.com
Jamil Pervez works as a Network Administrator, based in Kuwait with a Primary focus on Microsoft technologies. Microsoft Certified MCSE, MCTP, MCITP, CCNP, CCIP, CCVP with 20 years of experience in administering Windows Servers, Exchange, VMWare, Veeam B&R, Veritas BackupExec.

Related Articles

Latest Articles