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."