Friday, January 8, 2021

Proximity Placement Groups in Azure

When deploying your applications in Azure, spreading your IaaS resources across Azure Regions or Availability Zones creates network latency, which may impact the overall performance of your application. For e.g. Placing VMs in a single region reduces the physical distance between the instances. Placing them within a single availability zone will also bring them physically closer together. However, as the Azure footprint grows, a single availability zone may span multiple physical data centers, which may result in a network latency impacting your application.

A proximity placement group is an Azure Virtual Machine logical grouping capability that you can use to decrease the inter-VM network latency associated with your applications. When the VMs are deployed within the same proximity placement group, they are physically located as close as possible to each other. Proximity placement groups are particularly useful to address the requirements of latency-sensitive workloads. 



Use Proximity Placement Groups when you need
  • 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. 

How to deploy VMs in a Proximity Placement Group (PPG)?

You can create a PPG from Azure Portal, CLI or PowerShell. I'm going to walk you through Azure CLI.

- Make sure you have the latest Azure CLI installed and authenticate to your subscription

- Create a Resource Group and a PPG
  • az group create --name azurekcRG --location westus
  • az ppg create -n myPPG -g azurekcRG -l westus -t standard

- Create VMs in the PPG
az vm create -n myVM1 --admin-username kumara --admin-password \ abcxyz123 -g azurekcRG --image UbuntuLTS \
--ppg myPPG  --size Standard_D1_v2  -l westus

az vm create -n myVM2 --admin-username kumara --admin-password \ abcxyz123 -g azurekcRG --image UbuntuLTS \
--ppg myPPG  --size Standard_D1_v2  -l westus

- You can query for the VMs placed in the Proximity Placement Groups
az ppg show --name myppg --resource-group azurekcRG \
--query "virtualMachines"


Best Practices

  • For the lowest latency, use proximity placement groups together with accelerated networking. 
  • Deploy all VM sizes in a single template. In order to avoid landing on hardware that doesn't support all the VM SKUs and sizes you require, include all of the application tiers in a single template so that they will all be deployed at the same time.
  • If latency is your first priority, put VMs in a proximity placement group and the entire solution in an availability zone. But, if resiliency is your top priority, spread your instances across multiple availability zones (a single proximity placement group cannot span zones).

Conclusion

To achieve the lowest possible latency, you should deploy VMs within a proximity placement group. Some resources like Azure Shared Disks, SQL AlwaysOn, SAP Workloads are typically deployed in Proximity Placement Groups to achieve low latency. 

References

- Refer to Azure Docs for additional best practices and possible errors while deploying Proximity Placement Groups



No comments:

Post a Comment