Reducing latency through Proximity Placement groups in Azure

As a followup to my earlier blog post on Accelerated networking on Azure i am looking at other options available in Azure to reduce latency for Azure VM’s.

When you place your Azure VM’s in a single region, the physical distance between VM’s is reduced. Placing them within a single availability zone is another step you can take to deploy your virtual machines closer to each other. However, as the Azure footprint grows, a single availability zone may span multiple physical data centres resulting in network latency that can impact your overall application performance. If a region does not support availability zones or if your application does not use availability zones, the latency between the application tiers may increase as a result.

Enabling Accelerated networking reduces latency for Azure VM’s to a certain extent but Proximity placement group(PPG) provides Azure Virtual Machine logical grouping capability to further decrease inter-VM network latency.

As per Microsoft documentation, PPG can be used in the following cases

  • Low latency between stand-alone VMs.
  • Low Latency between VMs in a single availability set or a virtual machine scale set.
  • Low latency between stand-alone VMs, VMs in multiple Availability Sets, or multiple scale sets. You can have multiple compute resources in a single placement group to bring together a multi-tiered application.
  • Low latency between multiple application tiers using different hardware types. 

For the scope of this blog post we will be looking at the point #02(PPG in a single availability set). In the case of availability sets and virtual machine scale sets, you should set the proximity placement group at the resource level rather than the individual virtual machines.

Please see the github repository here for more detailed deployment steps

When proximity groups are enabled along with accelerated networking and availability sets the latency improves from ~72.9 ms to ~68.8 ms for an average of 10 test results on a set of 2 D3v2 VM’s within a single region.

Proximity groups enables moving VM’s closer to reduce latency but it compromises High availability if the VM’s are not placed in availability zones. To address this issue proximity groups can also be configured such that the VM’s are placed in separate availability zones to provide HA.

Some best practices to follow while creating PPG’s for new or existing virtual machines here

Accelerated Networking in Azure

Azure Accelerated Networking is network throughput performance improvement feature provided by a Microsoft for Azure Linux & Windows Azure VM’s. This feature enables a high-performance path and bypasses the host from the datapath, reducing latency and CPU utilisation, for use with the most demanding network workloads on supported VM types

Comparison

Without accelerated networking, all networking traffic in and out of the VM must traverse the host and the virtual switch.  For the best results, it is ideal to enable this feature on at least two VM’s connected to the same Azure Virtual Network. When communicating across VNets or connecting on-premises, this feature has minimal impact to overall latency.

Some of the Limitations & Constraints explained here and a list of list of supported VM instances here.

How do we test this feature for Azure Windows VM’s?

For the scope of this post the below are the parameters that will be tested with in the same virtual network using Standard D3 v2 (4 vcpus, 14 GiB memory) Azure VM’s .

  1. VM-VM Network performance throughput test – using iperf 
  2. Install Linux on both VM’s following a detailed steps here
  3. Install qperf
  4. VM-VM latency Test – using qperf

Before starting the above tests i have deployed the VM’s using below Azure CLI script in my Github repository here excluding the last 2 lines of code(so that we capture the results of latency tests and network performance test before enabling Accelerated networking).

Next few steps would involve you to download a few tools and deploy them on both the Azure VM’s. For the scope of the testing here i have considered below assumptions for latency and performance tests.

  • test-vm1 will act as a client
  • test-vm2 will be used for server communication

How to disable Accelerated Networking on your NIC??

Run the below Azure CLI commands

set-acc_networling_false

VM-VM Network performance Testing:

         Without Accelerated Networking                          With Accelerated Networking

iperf_before-after_acc_networking - combined

From the result, we can see D3 V2 VM egress throughput is ~2.82 Gbps with accelerated networking enabled while its ~2.01 Gbps with out the feature enabled.

VM-VM latency Test:

        Without Accelerated Networking                          With Accelerated Networking

qperf_before-after_acc_networking

From the result, we can see D3 V2 VM Network latency is ~72.9 microseconds. with accelerated networking enabled while its ~156.5 microseconds with out the feature enabled

High level charting to show that enabling accelerated networking for VM’s improves the overall network throughput and bandwidth

Data validated without Accelerated Networking

VM-Vm with out Acc Networking

Data validated with Accelerated Networking 

VM-Vm with Acc Networking

 

Blog at WordPress.com.

Up ↑