Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
83 views
in Technique[技术] by (71.8m points)

sql server - Thread(sqlservr*) % Processer Time exceeds 100%

I am writing a powershell script to figure out the CPU Utilization each stored procedure or SQL Query is taking. For that purpose I'm figuring out the SQL Server threads whose CPU Percent is greater than threshold (80%) and then finding those queries.

What I figured out that some of the SQL Utilization for Queries are beyond 100%. I know that this is because of multi cores and multi threading nature of the system, but I want this value to be exact, i.e., below 100% and show the actual value it is using for all the cores.

This is what I'm using

$ComputerName = $env:COMPUTERNAME
$PerfCounter = "Thread(sqlservr*)\% Processor Time"

$MaxSamples = 5

$ThreadData = Get-Counter  -Counter $PerfCounter -ComputerName $ComputerName -MaxSamples $MaxSamples -ErrorAction SilentlyContinue

Can anyone help me out in getting this value to be absolute - that is below 100%

question from:https://stackoverflow.com/questions/65880903/threadsqlservr-processer-time-exceeds-100

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...