Azure VM performance: credits and disk caps
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Day-to-day operations
-
Phase 3: Enterprise architecture
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
“The VM is slow” is about the vaguest ticket you’ll ever get, and Azure VM performance problems have a few causes you don’t find on physical servers. The two biggest are credits and caps. Burstable B-series VMs and small Premium SSD disks run fast while they have credits and then drop to a much lower baseline, and on top of that every VM size has its own disk and network caps.
That’s how a VM ends up “fast in testing, slow in production”: testing ran for ten minutes on full credits, while production runs all day on the baseline.
In the lab you’ll run a B1s VM and a small Premium SSD until their credits run out, watch the metrics that prove it, and fix each one by picking the right size rather than guessing.
| Time | You need | Cost | By the end you can |
|---|---|---|---|
| About 2 hours (mostly waiting while credits drain) | A free account and the CLI | About USD 0.40: a B1s and then a D2as_v5 VM, a 32 GiB Premium SSD and a short time at the P30 performance tier | Read CPU credit and disk burst metrics, spot steal time, and right-size VMs and disks for sustained load |
What it is, in one line
Azure VM performance depends on the CPU baseline and caps of the VM size and on each disk’s baseline, and burst credits only hide those limits for a while.
In Simple Words
The mobile data pack with a speed limit
Your phone plan gives you fast internet until you’ve used up the day’s high-speed data, and then it drops you to a slow speed for the rest of the day. Everything is quick in the morning, and by evening videos buffer even though nothing about your phone has changed. B-series VMs and small Premium disks work the same way, saving up credits while they’re idle and spending them on bursts, so if you run them hard all day they fall back to their slow baseline. A better phone won’t fix that. What you need is a plan whose normal speed fits how you use it, which here means a VM size or disk tier whose baseline matches your steady load.
Engineer's View
Credits, baselines and caps
- B-series CPU credits: each size has a baseline (for B1s it’s 10 percent of one vCPU). It earns credits for every hour it runs below the baseline and spends them when it goes above. Once there are no credits left, the VM is held at the baseline. The metrics to watch are CPU Credits Remaining and CPU Credits Consumed.
- Steal time: inside a throttled VM the “st” column in vmstat or top goes up, because the hypervisor is holding back CPU.
- Premium SSD bursting: disks of P20 and smaller have a baseline (P4 gets 120 IOPS and 25 MB/s) and can burst to 3,500 IOPS and 170 MB/s for up to 30 minutes on credits. The metric for this is Data Disk Used Burst IO Credits Percentage.
- Performance tiers: you can run a Premium SSD at a higher tier (for example P30, 5,000 IOPS) without changing its size, and set it back later.
- VM caps: every size has limits on uncached disk IOPS and MB/s and on network bandwidth (Lesson 58), and some sizes can burst too.
- Consumed percentage metrics: VM Uncached IOPS Consumed Percentage and Data Disk IOPS Consumed Percentage tell you which limit you’re hitting.
How it works, step by step
Here’s what happens to a B1s VM running a steady CPU-heavy job:
- A new B1s starts with some credits and earns more for every hour it runs below 10 percent.
- The job uses a full vCPU, so the VM burns about one credit a minute while earning only a few an hour.
- For a while Percentage CPU sits close to 100 and the job runs fast.
- Once CPU Credits Remaining hits zero, the platform holds the VM at its 10 percent baseline.
- Percentage CPU drops to around 10, the job gets ten times slower, and steal time inside the VM climbs.
Nothing restarts and no error appears. The app’s own logs only show everything getting slower, and the credit metric is the one thing that explains it.
Small Premium SSD disks follow the same pattern with I/O instead of CPU, so for both of them, size for the sustained load and treat bursting as a bonus for short peaks.
Drain CPU and disk credits and read the metrics
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
1A B1s VM with a small Premium SSD
Create the VM and a 32 GiB Premium SSD (P4), and then install the load tools:
az group create --name rg-saat-l72 --location centralindia --tags course=saatvedha-azure lesson=72 -o none
az vm create --resource-group rg-saat-l72 --name vm-perf --image Canonical:ubuntu-24_04-lts:server:latest --size Standard_B1s --public-ip-sku Standard --nsg-rule NONE --admin-username azureuser --generate-ssh-keys --tags course=saatvedha-azure lesson=72 -o none
az vm disk attach --resource-group rg-saat-l72 --vm-name vm-perf --name data-p4 --new --size-gb 32 --sku Premium_LRS --lun 0 -o none
az vm run-command invoke --resource-group rg-saat-l72 --name vm-perf --command-id RunShellScript --scripts 'apt-get update -qq > /dev/null; DEBIAN_FRONTEND=noninteractive apt-get install -y -qq stress-ng fio > /dev/null; stress-ng --version; fio --version' --query "value[0].message" -o tsv
$vmId = az vm show --resource-group rg-saat-l72 --name vm-perf --query id -o tsv2Read the starting point
Check the CPU credits and CPU use, and look at the steal time inside the VM:
az monitor metrics list --resource $vmId --metric "CPU Credits Remaining" "Percentage CPU" --interval PT5M --aggregation Average --query "value[].{metric:name.value, latest:timeseries[0].data[-2].average}" -o table
az vm run-command invoke --resource-group rg-saat-l72 --name vm-perf --command-id RunShellScript --scripts 'vmstat 5 2 | tail -1' --query "value[0].message" -o tsvYou should see something like this (metrics take 5 to 10 minutes to appear for a new VM):
Metric Latest
--------------------- ------
CPU Credits Remaining 30.0
Percentage CPU 1.8
[stdout]
0 0 0 512340 21404 245380 0 0 2 8 45 80 1 0 99 0 0The last column of vmstat is st, the steal time, and it’s 0 for now. The VM has about 30 credits, which is what a B1s starts with.


✅ Checkpoint: vm-perf is running with credits in the bank, a P4 data disk attached, and you can read credit, CPU and steal-time numbers.
Break It, Then Fix It
Both breaks need time for the credits to drain, so start each one and then wait as shown.
1Break it: the batch job that slows down after half an hour
Start a CPU-heavy job that runs for one hour, wait 45 minutes and then look again:
az vm run-command invoke --resource-group rg-saat-l72 --name vm-perf --command-id RunShellScript --scripts 'systemd-run --unit burn stress-ng --cpu 1 --timeout 3600s; echo started' --query "value[0].message" -o tsv
Start-Sleep -Seconds 2700
az monitor metrics list --resource $vmId --metric "CPU Credits Remaining" "Percentage CPU" --interval PT5M --aggregation Average --query "value[].{metric:name.value, latest:timeseries[0].data[-2].average}" -o table
az vm run-command invoke --resource-group rg-saat-l72 --name vm-perf --command-id RunShellScript --scripts 'vmstat 5 2 | tail -1' --query "value[0].message" -o tsvYou should see something like this:
Metric Latest
--------------------- ------
CPU Credits Remaining 0.0
Percentage CPU 10.2
[stdout]
1 0 0 498112 21500 250012 0 0 0 4 210 160 10 0 0 0 90The job still wants 100 percent, but the VM is running at about 10 percent with steal time near 90, because the credits are gone and the hypervisor is holding it at the B1s baseline. For the first 20 to 30 minutes the same job ran at full speed, and that’s how it got through testing.
To fix it, give a steady CPU load a size whose baseline is 100 percent. Stop the job and resize to a non-burstable size (the VM will restart):
az vm run-command invoke --resource-group rg-saat-l72 --name vm-perf --command-id RunShellScript --scripts 'systemctl stop burn; echo stopped' --query "value[0].message" -o tsv
az vm resize --resource-group rg-saat-l72 --name vm-perf --size Standard_D2as_v5 -o none
az vm show --resource-group rg-saat-l72 --name vm-perf --query hardwareProfile.vmSize -o tsvYou should see Standard_D2as_v5. B-series is still a good fit for VMs that sit mostly idle, like small web servers and jump boxes.
2Break it: the disk that was fast on day one
Run a steady random-read test against the P4 disk for 45 minutes, reporting every 5 minutes, and then read the first and last results:
az vm run-command invoke --resource-group rg-saat-l72 --name vm-perf --command-id RunShellScript --scripts 'systemd-run --unit io fio --name=steady --filename=/dev/disk/azure/scsi1/lun0 --rw=randread --bs=4k --iodepth=32 --ioengine=libaio --direct=1 --runtime=2700 --time_based --status-interval=300 --output=/root/fio.log; echo started' --query "value[0].message" -o tsv
Start-Sleep -Seconds 2760
az vm run-command invoke --resource-group rg-saat-l72 --name vm-perf --command-id RunShellScript --scripts 'grep -E read:.IOPS= /root/fio.log | head -2; grep -E read:.IOPS= /root/fio.log | tail -2' --query "value[0].message" -o tsv
az monitor metrics list --resource $vmId --metric "Data Disk Used Burst IO Credits Percentage" --interval PT5M --aggregation Average --query "value[].{metric:name.value, latest:timeseries[0].data[-2].average}" -o tableYou should see something like this:
[stdout]
read: IOPS=3496, BW=13.7MiB/s (14.3MB/s)(4097MiB/300001msec)
read: IOPS=3412, BW=13.3MiB/s (13.9MB/s)(3998MiB/300002msec)
read: IOPS=121, BW=484KiB/s (496kB/s)(142MiB/300003msec)
read: IOPS=120, BW=482KiB/s (493kB/s)(141MiB/300001msec)
Metric Latest
----------------------------------------- ------
Data Disk Used Burst IO Credits Percentage 100.0For about half an hour the disk burst to around 3,500 IOPS, and once its burst credits were gone it dropped to the P4 baseline of 120 IOPS. Anyone who benchmarked it for five minutes would have expected 3,500 forever.
To fix it, raise the disk’s performance tier to match the sustained need, without resizing or detaching it, and test again for 5 minutes:
az disk update --resource-group rg-saat-l72 --name data-p4 --performance-tier P30 -o none
az disk show --resource-group rg-saat-l72 --name data-p4 --query "{tier:tier, iops:diskIOPSReadWrite, mbps:diskMBpsReadWrite}" -o table
az vm run-command invoke --resource-group rg-saat-l72 --name vm-perf --command-id RunShellScript --scripts 'fio --name=check --filename=/dev/disk/azure/scsi1/lun0 --rw=randread --bs=4k --iodepth=32 --ioengine=libaio --direct=1 --runtime=300 --time_based --group_reporting | grep IOPS=' --query "value[0].message" -o tsvYou should see tier P30 with 5,000 IOPS, and fio giving a steady result in the thousands. On D2as_v5 the VM’s own uncached limit of about 3,750 IOPS may now be the ceiling, and you can confirm that with VM Uncached IOPS Consumed Percentage.

3Clean up
Delete the lab resource group:
az group delete --name rg-saat-l72 --yes✅ Checkpoint: You proved a CPU credit throttle and a disk burst throttle with metrics, and fixed each by sizing for sustained load.
This happened at work
The report server that was fast every Monday
A logistics company ran its nightly reports on a B4ms VM because it was cheap and “fast enough in testing”. On Mondays the reports finished in 40 minutes, and by Thursday they were taking more than four hours. The team blamed the database first, then the network, then a memory leak. What was going on was simpler. The VM sat idle all weekend banking credits, Monday’s run spent them and finished quickly, and from Tuesday on the nightly runs started with almost no credits, so the VM spent most of the night at its baseline. CPU Credits Remaining had been drawing a perfect weekly saw-tooth the whole time, and nobody had looked at it.
What they changed: the report server moved to a D-series size and the database disk was set to a tier that matched its sustained IOPS. Every B-series VM in the company also got an alert for when CPU Credits Remaining stays below 10 percent of its maximum for an hour.
Common mistakes and troubleshooting
| Mistake | What you see | What to do |
|---|---|---|
| B-series for steady CPU load | Fast at first, then about baseline | Use a non-burstable size; alert on credits. |
| Benchmarking for a few minutes | Burst numbers mistaken for normal | Test longer than the burst period. |
| Small Premium disk for a database | 3,500 IOPS, then 120 | Pick tier or size by baseline; use performance tiers. |
| Raising disk IOPS when the VM is capped | No improvement | Check VM Uncached Consumed Percentage first. |
| Ignoring steal time | “CPU is idle” inside, but slow | Check st in vmstat or top. |
| Looking only at Percentage CPU | Misreading a throttle as low load | Read CPU Credits Remaining alongside it. |
Interview questions
Click a question to open it. Each one is phrased the way an interviewer would ask it, and under it you’ll find why they ask and one way you could answer in your own words.
Fresher level
1. What is a B-series VM?
Why they ask this: The basic concept.
How you might answer: It’s a burstable VM. It runs at a baseline CPU level, earns credits while it’s below that and spends them to burst above it.
2. What happens when B-series credits run out?
Why they ask this: Key behaviour.
How you might answer: The VM gets held at its baseline CPU, which can be 10 to 40 percent of its vCPUs, until it earns credits again.
3. What is Premium SSD bursting?
Why they ask this: Disk basics.
How you might answer: Small Premium SSD disks can go above their baseline IOPS and throughput for a limited time, using credits they earned while idle.
2–5 years experience
4. A VM is fast in the morning and slow in the afternoon. What do you check?
Why they ask this: A real troubleshooting path.
How you might answer: For B-series I’d look at CPU Credits Remaining, Percentage CPU and steal time. Then the disk burst credit and consumed metrics, the VM’s uncached caps, and how the workload changes over the day.
5. How do you choose between a bigger disk and a performance tier?
Why they ask this: Practical decision.
How you might answer: A performance tier raises IOPS and throughput without paying for space you don’t use, and you can lower it later. A bigger size is permanent, though it does give you more capacity.
6. What does high steal time tell you?
Why they ask this: Linux depth.
How you might answer: It means the hypervisor isn’t giving the VM the CPU it’s asking for, which you usually see with B-series throttling or an overcommitted host.
Senior level
7. How would you right-size 300 VMs?
Why they ask this: They want a method.
How you might answer: I’d collect 30 days of CPU, memory, disk and network metrics and compare them with the baselines and caps of each size, and use Azure Advisor. Steady loads come off burstable sizes, and I’d validate with load tests that run longer than the burst windows.
8. When is B-series the right choice?
Why they ask this: Cost judgement.
How you might answer: When average utilisation is low with short peaks, like small web servers, dev VMs, jump boxes or domain controllers in small sites.
9. How do you monitor for credit exhaustion at scale?
Why they ask this: Operations.
How you might answer: With Azure Monitor alerts on CPU Credits Remaining and Data Disk Used Burst IO Credits Percentage, scoped by tag to the burstable VMs and small disks.
Quick quiz
Q1. B1s baseline CPU?
- 100 percent
- 10 percent of one vCPU
- 50 percent
- No baseline
Show answer
B — B1s runs at 10 percent once credits are gone.
Q2. Which metric proves a B-series throttle?
- Network In
- CPU Credits Remaining
- Disk Read Bytes
- Available Memory
Show answer
B — Zero credits means held at baseline.
Q3. P4 baseline IOPS?
- 3,500
- 120
- 500
- 5,000
Show answer
B — 3,500 is only the burst figure.
Q4. How do you raise a Premium SSD’s IOPS without resizing?
- Change the VM
- Set a higher performance tier
- Enable caching
- Add a NIC
Show answer
B — Performance tiers change IOPS online.
Q5. High steal time inside the VM means?
- Disk full
- The hypervisor is withholding CPU
- DNS failure
- Memory leak
Show answer
B — Typical of credit throttling.
Quick recap
By now you can explain “fast at first, slow later” on Azure and prove it with the right metric instead of guessing.
- Burst credits hide baselines for a limited time.
- CPU Credits Remaining at zero means held at baseline.
- Small Premium SSDs burst to 3,500 IOPS, then fall to baseline.
- Size VMs and disks for sustained load.
- Check consumed-percentage metrics before spending more.
Next lesson
Lesson 73: Billing surprises: find what costs money → Next you’ll track down what’s costing money, from forgotten disks to idle gateways, and stop it before the bill arrives.
Further reading: Azure VM performance
Want to go deeper into Azure VM performance? See Microsoft’s B-series CPU credit model and Managed disk bursting. You can also see the full plan for this course on the Azure Cloud Administration course page.
