Saving money in Azure by using burstable (B series) instances
Amyn Jaffer
Head Of Ultima Labs
19/04/2021

Most admins know of B series machines in Azure but many are afraid to use them. For those of you who aren’t aware, B series machines are perfect for burstable workloads, or development workloads where there isn’t heavy usage overnight. If you have workloads like this then you are likely to benefit from using them.

Instead of having a standard performance profile, B series machines use credits - we’ll get on to those in a second. With savings of about 55%[1] using B series machines can bring you huge cost savings whilst not impacting on performance if used correctly.

There are 3 main metrics that you need to know:

Base CPU Performance

Max CPU Performance

Credits

Usage under this threshold will accrue credits but usage above this threshold will consume credits.

This is the maximum available performance of the virtual machines. It is calculated as number of cores multiplied by 100%.

The “currency” used when additional performance is required above the base CPU performance.

Every B series machine has a different Base CPU Performance, Max CPU Performance and maximum number of credits that can be banked. These figures should help you select the most appropriate machine to use – it’s worth bearing in mind that there are other limitations such as storage, bandwidth and number of NICs that can be allocated.

Size

vCPU

Memory (GB)

Base CPU performance

Max CPU performance

Max banked credits

B2ms

2

8

60%

200%

864

B4ms

4

16

90%

400%

1296

B8ms

8

32

135%

800%

2909

B16ms

16

64

270%

1600%

3888

 

 

 

 

 

 

 

 

 

You may be wondering how you can have over 100% CPU usage. Each vCPU is allocated a maximum of 100% and therefore a 16 vCPU machine can have a maximum usage of 1600%.

From here on in it is going to get a lot more maths intensive, don’t say I didn’t warn you!

First off we are going to look into how credit usage or accumulation works, credits are accumulated or used per hour. For this we have two metrics that are used; base performance of the machine and usage over the last hour. We then enter these values into the following equation:

((Base CPU performance - CPU utilisation) / 100) * 60

To make this easier to visualise here are a couple of examples. For these examples we will use B4ms machines, so the maximum CPU performance is 400%:

Low Utilisation

Medium Utilisation

High Utilisation

CPU utilisation: 12%

Base CPU performance: 90%

CPU utilisation: 95%

Base CPU performance: 90%

CPU utilisation: 234%

Base CPU performance: 90%

Using the above equation, we get the following:

((90-12)/100)*60

Credited accrued: 46.8

Using the above equation, we get the following:

((90-95)/100)*60

Credits accrued: -3 (3 credits used)

Using the above equation, we get the following:

((90-234)/100)*60

Credits accrued: -91.8 (91.8 credits used)

If you run out of credits then your machine is pinned to the base CPU performance cap, therefore it’s important to make sure that your bursts of workloads aren’t going to consume all of your credits! To make sure that you aren’t impacted when you first boot a machine you are given a buffer of initial credits, ranging from 30 for the smallest sizes to 600 for the largest.

There are however caveats to the credits, the banking of credits only works if the machines are not redeployed. If machines are redeployed then the banked credit count is set to the initial credits amount, so try and avoid redeploying machines unless you really have to! However, if you stop and start a machine on the same node you retain the credit count so if you need to perform a reboot this won’t affect your credits.

To get started with calculating if you might be able to use B series machines, you’ll need to pull your virtual machine usage and  model this using the equation mentioned previously. If you end up with a net positive credit amount, then you can move to a B series machine without issue.

With IA-Cloud we log the performance of virtual machines for a 30-day rolling period, we then model this data to calculate if you can move machines to B series machines without a performance impact. These recommendations are surfaced in our dashboard, alongside many other optimisation recommendations, for you to action as and when you decide.

              -----------------------------------------------------------------------------------------

IA-Cloud is our automated management, monitoring and optimisation platform for Microsoft Azure workloads.  IA-Cloud provides easy to understand optimisation and performance analytics in a consolidated platform, surfacing only the insights that are important to you, helping you to manage and optimise your environment without sifting through the noise.

There’s so much more to the tool, so why not find out more at https://www.ultima.com/ia-cloud 

 

 

 

 

[1] Based on pricing from UK south on 26th March 2021


Full Name