Question: How can I find CurrentClockSpeed and MaxClockSpeed using Powershell?
I’d like to audit our servers and identify inefficiencies around processor consumption. The VM administrator on site claims the servers are being under utilised therefore there is no justification to request another VM server.
The figures they’ve presented seem inaccurate . They are based on smoothing out peaks over a period of time – which is not an accurate methodology in understanding how CPU is utilised by SQLServer
Answer: This is one of those questions which I get from DBAs . In an age of cost – cutting , justifying resource usage and having to report on SQL Server resource consumption is part of the job.
Some background information on CPU
To get the maxclockspeed and currentclockspeed I use the Windows Management Instrumentation(WMI) Object – win32_processor.
The Powershell cmdlet Get-WmiObject is used. Here is a powershell script:
Get-WmiObject win32_processor | select -First 1 -Property name, currentclockspeed, maxclockspeed | Format-List
When the server is under load and the currentclockspeed is persistently lower than the maxclockspeed, it is worth considering changing the Windows Power Options. The default build is Balanced – which has an impact of redistributing clockspeed based on energy consumption and performance algorithm.
Changing the Power Option to Performance changes the relationship between Performance and Energy Consumption i.e favouring performance at the cost of increased energy consumption.
Read More on CPU and SQL Server