Virtual machine is slow

Justine Yamane 0 Reputation points

how do we trouble shoot why our virtual machine is running so slow?

  1. Hemalatha 14,525 Reputation points Microsoft External Staff Moderator

    Hello Justine,

    Thank you for reaching out regarding the performance concern with your virtual machine.

    Slowness in an Azure VM can occur due to multiple factors such as high resource utilization, storage performance limits, network latency, or changes in workload behavior. To effectively troubleshoot this issue, it is important to identify where the performance bottleneck is occurring.

    We recommend starting with a review of VM resource utilization using Azure Monitor. Please navigate to Azure Portal → Virtual Machine → Monitoring → Metrics and review CPU, memory, disk, and network usage during the time when the issue was observed. Consistently high CPU usage may indicate that the workload exceeds the VM’s current capacity, while high memory utilization can lead to paging and degrade performance.

    Documentation: Monitor virtual machines in Azure

    Next, please check disk performance metrics such as latency, IOPS, and throughput. Disk performance is a common cause of slowness, especially for workloads with heavy read/write operations. Each VM and disk type has defined IOPS and throughput limits, and reaching these limits can result in slower response times. You can review the disk configuration from VM → Disks.

    Documentation: Virtual machine and disk performance

    It is also important to verify the processes running inside the virtual machine. In some cases, the Azure platform metrics may appear normal, but a specific application or background process within the OS might be consuming high resources.

    For Windows VMs, you can check Task Manager, and for Linux VMs, commands such as top or htop can help identify resource-intensive processes.

    Additionally, we recommend running Azure Performance Diagnostics (PerfInsights), which is a diagnostic tool designed to collect and analyze detailed performance data. It helps identify issues related to CPU contention, memory pressure, disk latency, and OS-level bottlenecks by generating actionable insights.

    Documentation: Use performance diagnostics in Azure Monitor to troubleshoot VM performance problems

    Troubleshoot Azure virtual machine performance on Linux or Windows

    Finally, please review whether the current VM size aligns with your application requirements. If the workload has increased over time, the existing VM SKU may not be sufficient in terms of CPU, memory, or disk performance. In such cases, resizing the VM to a higher SKU or an appropriate VM family may help improve performance.

    Reference Documentations: Change the size of a virtual machine

    Run performance diagnostics reports on Azure virtual machines

    Slow Azure VM Start operations when extensions are "Failed"

    Hope this helps! Please let me know if you have any queries in comments.

  2. Hemalatha 14,525 Reputation points Microsoft External Staff Moderator

    Hello Justine

    Just checking if provided information was helpful! Please let me know if you have any queries.


Sign in to comment

3 answers

  1. SUNOJ KUMAR YELURU 18,336 Reputation points MVP Volunteer Moderator

    Hello @Justine Yamane,

    Thank you for reaching out Q&A forum.

    Run these immediately on the VM to get a snapshot:

    Linux

    bash

    # Overall CPU, memory, load average
    top -bn1 | head -20
    
    # CPU per core
    mpstat -P ALL 1 3
    
    # Memory
    free -h
    
    # Disk I/O — what's consuming it
    iostat -xz 1 5
    
    # Top disk I/O by process
    iotop -o -b -n 3
    
    # Network
    sar -n DEV 1 5
    
    # What processes are consuming most resources
    ps aux --sort=-%cpu | head -20
    ps aux --sort=-%mem | head -20
    

    Windows

    powershell

    # Quick resource snapshot
    Get-Process | Sort-Object CPU -Descending | Select-Object -First 20
    Get-Process | Sort-Object WorkingSet -Descending | Select-Object -First 20
    
    # Disk I/O
    Get-Counter '\PhysicalDisk(*)\Disk Bytes/sec'
    Get-Counter '\Processor(_Total)\% Processor Time'
    Get-Counter '\Memory\Available MBytes'
    

    Use Azure's Built-in Diagnostics

    Performance Diagnostics Extension

    In the portal: VM → Diagnose and Solve Problems → Performance Diagnostics

    This runs automated checks and gives you a report on:

    • CPU bottlenecks
    • Memory pressure
    • Disk throttling
    • Network issues
    • Top resource-consuming processes

    Azure Monitor / Log Analytics

    If you have the Azure Monitor Agent installed:

    kusto

    // Top CPU consuming processes over last hour
    Perf
    | where TimeGenerated > ago(1h)
    | where CounterName == "% Processor Time"
    | where InstanceName != "_Total"
    | summarize avg(CounterValue) by Computer, InstanceName
    | top 20 by avg_CounterValue desc
    

    kusto

    // Disk latency
    Perf
    | where CounterName == "Avg. Disk sec/Read" or CounterName == "Avg. Disk sec/Write"
    | where TimeGenerated > ago(1h)
    | summarize avg(CounterValue) by CounterName, bin(TimeGenerated, 5m)
    | render timechart
    
    

    If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

    0 comments No comments

    Sign in to comment
  2. Jose Benjamin Solis Nolasco 8,561 Reputation points Volunteer Moderator

    Welcome to Microsoft Q&A

    Hello @Justine Yamane

    Microsoft has a built-in tool that will figure it out for you,

    Here is the easiest way to troubleshoot:

    Open your Virtual Machine in the Azure Portal.

    Scroll down the left menu until you find Performance diagnostics (under the Help/Troubleshooting section).

    Click the button to Install and Run a diagnostic test.

    1. Choose the "Performance Analysis" option and let it run for a few minutes while the machine is acting slow.
    2. Once it finishes, it will generate a very easy-to-read report. It will tell you exactly what is slowing the machine down. For example, it might tell you "Your disk is maxed out" or "An antivirus program is using 99% of your CPU."

    If the report shows you are simply maxing out the machine's limits, you will just need to click "Size" on the left menu and upgrade the VM to a slightly larger size!

    😊 If my answer helped you resolve your issue, please consider marking it as the correct answer. This helps others in the community find solutions more easily. Thanks!

    1. Jose Benjamin Solis Nolasco 8,561 Reputation points Volunteer Moderator

      @Justine Yamane just following up do you need more guidance or assistance?


    Sign in to comment
  3. AI answer

    Use Azure’s built-in monitoring and diagnostics to identify which resource is the bottleneck (CPU, memory, disk, or network), then remediate based on what’s high.

    1. Enable and review VM diagnostics
    • In the Azure portal, open the VM.
    • Under Monitoring, select Diagnostics settings.
    • Select a storage account and enable guest-level monitoring.
    • This lets Azure collect performance counters from inside the VM for deeper analysis.
    1. Check CPU utilization
    • In the VM’s Monitoring section, open Metrics.
    • Set the time range to cover when the VM feels slow.
    • In Metric, select CPU Percentage.
    • Interpret trends:
      • Spiking: May be scheduled tasks or periodic jobs. Confirm if this is expected.
      • Spike up and constant: Often a new or changed workload. Identify which process is consuming CPU.
      • Constant high: Check if the VM has always run at this level; if not, find the process causing it.
      • Steadily increasing: May indicate inefficient code or growing workload.
    1. Remediate high CPU
    • If CPU stays above ~95%:
      • For immediate relief, resize the VM to a SKU with more vCPUs.
      • In the OS, identify and troubleshoot the high-CPU process (optimize code, adjust workload, or move part of the load elsewhere).
    • If CPU is still ~95% after resizing, verify whether throughput or performance actually improved; if not, focus on application-level troubleshooting.
    1. Check storage and disk performance
    • For unmanaged disks:
      • In the VM blade, go to SettingsDisk and note the storage account.
      • Open that storage account → Metrics to review I/O-related metrics.
    • Look for signs of I/O bottlenecks (high latency, low throughput relative to expectations) and consider:
      • Moving to higher-performance disks.
      • Distributing I/O across more disks.
      • Optimizing application I/O patterns.
    1. Validate VM size vs. workload (CPU, memory, network)
    • Ensure the VM size provides enough RAM and network bandwidth for the workload:
      • Memory: Choose a VM size with sufficient RAM for what’s configured and in use.
      • Network: VM size determines network bandwidth; if migrated from on-premises (often 10 Gbps), pick a size that meets throughput needs. In many cases, VM or disk throughput limits, not the network, are the bottleneck.
    1. Use PerfInsights for deeper analysis
    • PerfInsights is recommended for Azure VM performance issues.
    • It analyzes CPU, memory, and I/O and provides best-practice recommendations.
    • From the Azure portal:
      • Go to the VM blade and select Performance diagnostics, then install and run PerfInsights (installs as an extension).
      • Or go to Diagnose and Solve ProblemsVM Performance IssuesTroubleshoot to launch the same tool.
    • After it runs, download and review the report for identified bottlenecks and remediation guidance.

    By following these steps—enabling diagnostics, checking CPU and storage metrics, validating VM size, and running PerfInsights—it’s possible to systematically identify why an Azure VM is slow and apply targeted fixes.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.
Sign in to answer

Your answer