The CPU usage on the Azure VM is consistently peaking at 99% due to the Service Host Local System. This high level of usage is causing performance issues and impacting the overall efficiency of the system. It is imperative that we address this issue promp

Rajesh Rai 0 Reputation points
2024-09-30T04:24:27.0766667+00:00

Our virtual machine frequently experiences hang-ups. Upon investigation using the task manager, we discovered that the CPU usage reaches 99%, with the main contributor being the service host local system process. By stopping this service, the virtual machine returns to normal operation. Is there an automated solution available to resolve this issue?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,018 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Lijitha B 515 Reputation points Moderator
    2024-09-30T13:24:50.82+00:00

    Hi Rajesh Rai,
    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    I understand that Azure virtual machine frequently experiences performance issues due to high CPU usage (up to 99%) caused by the Service Host Local System process.

    Here are a series of steps to effectively address the issue:
    Open Task Manager by pressing Ctrl + Shift + Esc.
    Go to the Details tab and find the high CPU usage svchost.exe. Right-click it and select "Go to service(s)" to identify the specific service.
    Press Windows + R, type services.msc, and hit Enter.
    Locate the identified service, right-click it, and select Properties. Click Stop to halt it temporarily. Change Startup type to Disabled or Manual to prevent it from starting again.

    Create a custom power Shell script to automate stopping the service. Use the following code:
    $serviceName = "ServiceName" # Replace with the actual service name
    $service = Get-Service -Name $serviceName
    if ($service.Status -eq 'Running') {
    Stop-Service -Name $serviceName -Force
    }
    Set-Service -Name $serviceName -StartupType Disabled
    Save the script as StopService.ps1.
    Open Task Scheduler and create a new task that runs the script at startup for automation.
    Ensure your system and drivers are kept up to date to prevent future issues.

    Please check for further reference: Troubleshoot high-CPU issues on Azure Windows virtual machines

    If you have any further queries, do let us know.

    If the answer is helpful, please click "Accept Answer" and "Upvote it."

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.