Skip to content

Commit 8cf60d5

Browse files
authored
Merge pull request #1666 from emad-almousa/patch-2
Update troubleshoot-high-cpu-usage-issues.md
2 parents f907e15 + f2e022f commit 8cf60d5

1 file changed

Lines changed: 23 additions & 19 deletions

File tree

support/sql/database-engine/performance/troubleshoot-high-cpu-usage-issues.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Troubleshoot high-CPU-usage issues in SQL Server
33
description: This article provides a procedure to help you fix high-CPU-usage issues on a server that is running SQL Server.
4-
ms.date: 01/25/2024
4+
ms.date: 10/23/2024
55
ms.custom: sap:SQL resource usage and configuration (CPU, Memory, Storage)
66
ms.topic: troubleshooting
77
ms.reviewer: jopilov, v-jayaramanp, v-sidong
@@ -34,24 +34,28 @@ Use one of the following tools to check whether the SQL Server process is actual
3434

3535
- You can use the following PowerShell script to collect the counter data over a 60-second span:
3636

37-
```powershell
38-
$serverName = $env:COMPUTERNAME
39-
$Counters = @(
40-
("\\$serverName" + "\Process(sqlservr*)\% User Time"), ("\\$serverName" + "\Process(sqlservr*)\% Privileged Time")
41-
)
42-
Get-Counter -Counter $Counters -MaxSamples 30 | ForEach {
43-
$_.CounterSamples | ForEach {
44-
[pscustomobject]@{
45-
TimeStamp = $_.TimeStamp
46-
Path = $_.Path
47-
Value = ([Math]::Round($_.CookedValue, 3))
48-
}
49-
Start-Sleep -s 2
50-
}
51-
}
52-
```
53-
54-
If `% User Time` is consistently greater than 90 percent (% User Time is the sum of processor time on each processor, its maximum value is 100% * (no of CPUs)), the SQL Server process is causing high CPU usage. However, if `% Privileged time` is consistently greater than 90 percent, your antivirus software, other drivers, or another OS component on the computer is contributing to high CPU usage. You should work with your system administrator to analyze the root cause of this behavior.
37+
```powershell
38+
$serverName = $env:COMPUTERNAME
39+
$Counters = @(
40+
("\\$serverName" + "\Process(sqlservr*)\% User Time"), ("\\$serverName" + "\Process(sqlservr*)\% Privileged Time")
41+
)
42+
Get-Counter -Counter $Counters -MaxSamples 30 | ForEach {
43+
$_.CounterSamples | ForEach {
44+
[pscustomobject]@{
45+
TimeStamp = $_.TimeStamp
46+
Path = $_.Path
47+
Value = ([Math]::Round($_.CookedValue, 3))
48+
}
49+
Start-Sleep -s 2
50+
}
51+
}
52+
```
53+
54+
If `% User Time` is consistently greater than 90 percent (% User Time is the sum of processor time on each processor, its maximum value is 100% * (no of CPUs)), the SQL Server process is causing high CPU usage. However, if `% Privileged time` is consistently greater than 90 percent, your antivirus software, other drivers, or another OS component on the computer is contributing to high CPU usage. You should work with your system administrator to analyze the root cause of this behavior.
55+
56+
- [Performance Dashboard](/sql/relational-databases/performance/performance-dashboard): In SQL Server Management Studio, right click **\<SQLServerInstance\>** and select **Reports** > **Standard Reports** > **Performance Dashboard**.
57+
58+
The dashboard will illustrate a graph titled **System CPU Utilization** with a bar chart. The darker color indicates the SQL Server engine CPU utilization, while the lighter color represents the overall operating system CPU utilization (see the legend on the graph for reference). Select the circular refresh button or <kbd>F5</kbd> to see updated utilization.
5559

5660
## Step 2: Identify queries contributing to CPU usage
5761

0 commit comments

Comments
 (0)