You come across them more often than you would hope. Non-redundant infrastructure solutions based on a few virtual machines (VM). In this article, I'll go over some little tricks you can use to speed up network performance for your Azure VM in such a scenario.
In this post, I will illustrate the possibilities assuming a simple app architecture with two VMs. For example an App VM and a SQL VM in the same network. Both layers (App & Database) are configured as "single server" in this initial situation.
Accelerated network operations through Azure
The first tip is the "Accelerated network operation" option. This is independent of the initial situation described above and therefore also applies to more complex and redundant architectures.
The accelerated network operation is characterized by the fact that the host and virtual switch of the Azure hosting infrastructure is bypassed and therefore also less loaded.
This not only results in latency being reduced, but also jitter and CPU utilization. This means that you not only accelerate the network communication, but in fact also positively affect the effectively available CPU resources. For more information, Microsoft describes accelerated network operation in detail here.
When creating a VM you can easily activate the radio button "accelerated network operation" under "network".
Physical location of the VM in the Azure data centers
The network speed between the two VMs described in the initial situation can also be influenced by the physical position of the VM in the Azure data centers. However, you can only control this indirectly by using an "Availability Set".
An Availability Set has Update & Fault Domains, of which you make use of the Fault Domain. A Fault Domain defines a VM group that shares both power source and network components like switches. So, for simplicity, you can think of a fault domain as a rack and the VMs are physically close to each other or even on the same host using the shared network components. This reduces latency accordingly.
Single Azure VM
So if I take my initial situation with the one App VM and the SQL VM, I place the two VMs in an Availability Set and there in the same Fault Domain. The other fault domains remain empty in this scenario.
Redundant Azure VM
If I change the initial situation and both VMs are created redundantly (e.g. 3 App VMs & 3 SQL VMs) I have to make sure that the redundant VMs are not placed in the same fault domain. This is Microsoft's way of ensuring that the redundant VMs draw both different network components and power from a different source.