How to Right Size VMs

jbassking 106 Reputation points
2022-02-03T16:37:00.583+00:00

I have 2 Standard B2s VMs. They're both behind an Azure basic load balancer. The servers average 750k request per week. We're hosting our API and website on them. The API uses an Azure SQL Standard S2: 50 DTUs. The issue is that the clients receive too many "Task Cancelled" errors.

How would I determine the best size for the VMs?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,585 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. kobulloc-MSFT 26,131 Reputation points Microsoft Employee
    2022-02-03T18:25:29.457+00:00

    Hello, @jbassking !

    When looking at the right size for your server based on traffic, the VM size documentation gives general guidance for which VM will work best for your scenario. Looking through the performance history on your VM using something like Monitoring in the portal or Azure Monitor would give you the best insight into what your VM needs are. Usually you would want to increase your compute power either by scaling up or scaling out.

    The B-series VMs are described as ideal for workloads that don't need full performance of the CPU, like low to medium traffic web servers. If you are seeing an average of 3 million or more requests a month, you may need to increase your VM compute power or add another VM.

    Looking at just the B-series, going from a B2s to a B2ms or a B4ms would increase your base CPU performance as well as your max CPU performance in the case of the B4ms:

    https://learn.microsoft.com/en-us/azure/virtual-machines/sizes-b-series-burstable

    VM logs and diagnostics
    There's a lot of information that is available for your VM resource under Monitoring. Metrics and logs in particular will give you useful information to see when your VM is under heavy load. Azure Monitor also offers several services that will give you detailed information you can use to determine your VM utilization:

    Scaling up (more power)
    There are more powerful options within the general purpose B and D size VMs (low to medium traffic web servers) as well as options in compute optimized F size VMs (medium traffic web servers):

    Scaling out (more VMs)
    There are a lot of options here, especially when it comes to automatically scaling to adjust to changing traffic loads. This is a pretty large topic but a good place to start would be to look at Azure Virtual Machine Scale Sets, which allows you to automatically increase or decrease VM count in response to traffic (or on a specific schedule):

    https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/overview

    2 people found this answer helpful.
    0 comments No comments