0PricingLogin
Azure Fundamentals · Lesson

Right-Sizing and Autoscaling

Analyse VM performance data to right-size instances, implement scheduled autoscale for predictable workloads, and use VMSS spot instances for batch workloads.

What Is Right-Sizing?

Right-sizing is the process of matching Azure VM or service SKUs to the actual resource requirements of your workload — neither over-provisioning (wasting money) nor under-provisioning (risking performance degradation). Most organisations initially over-provision by 30–50% out of caution when migrating from on-premises. Regular right-sizing analysis, typically monthly, can recover a significant portion of that over-spend without impacting application performance.

Analysing VM Performance Data

Use Azure Monitor metrics and VM Insights to collect CPU, memory, disk IOPS, and network throughput data over at least 30 days. Look for the peak (P95 or P99) utilisation, not the average, to ensure the right-sized VM can handle traffic spikes. Azure Advisor's right-sizing recommendation uses a 7-day lookback by default, but you can extend this to 30 or 60 days in the Advisor configuration for more representative data.

# Get P95 CPU utilisation for a VM over 30 days
az monitor metrics list \
  --resource /subscriptions/<sub>/resourceGroups/myRG/providers/Microsoft.Compute/virtualMachines/myVM \
  --metric 'Percentage CPU' \
  --aggregation Percentile \
  --interval P1D \
  --start-time 2024-05-01T00:00:00Z \
  --end-time 2024-06-01T00:00:00Z

All lessons in this course

  1. Identifying and Eliminating Waste
  2. Right-Sizing and Autoscaling
  3. Azure Savings Plans and Reservations
  4. FinOps and Chargeback Models
← Back to Azure Fundamentals