r/SQLServer • u/Kenn_35edy • Sep 03 '25
Question Sql server utilization increased from 40 % to 60%
Hi we have sql server where cpu use to range between 30-40% .But for last 2 days it has been in range 60% and higher .We have checked and its mostly sql server .How to check query which is causing higher cpu utilization. I see many query running there is no pattern to it
I have checked below link https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/performance/troubleshoot-high-cpu-usage-issues
should i run current one or should i execute query which gave historical ones
Also i have doubt , in query which outputs current one does ordering by cpu time desc gives right query ?
Also we have process tracking which trakes and dumps long running query in tables. IN those i am seeing various query with last waittype sosscheduler_yield , pageIolatchIO** and some times those related to locks....
So in high cpu case should i target those query which has lastwaitype as sosscheduler_yield or should I also target pageIolatchIO** ....
is sos_scheduler_yelid purley related to CPU while pageIOlatch isn`t ? wont query with pageIOLatch wont increase CPU usage ?
4
u/Krassix Sep 03 '25
- did you have changes in your software?
- did you have drastic changes in your data?
- do you have query-store enabled?
- do you do regular update statistics?
- did you try to delete your plancache? (dbcc freeproccache)
5
u/ShimReturns Sep 04 '25
If it were me first thing would be to use whoisactive to see what is running frequenty or long. https://github.com/amachanic/sp_whoisactive/releases
I'd also try running DMVs to see if to have any queries massively high compared to others. https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/performance/troubleshoot-high-cpu-usage-issues
You could also enable/use query store to identify high CPU queries.
If you haven't had a release or changes it's probably a plan gone bad. Or maybe you got loaded up with a ton of data.
4
u/seniordbauk Sep 04 '25
If not already done please turn on query store for all of your database. You can find out the top CPU queries easily and also if a query regresses in future it's easy to find out which one. Am happy to help you one on one if you want to do a zoom / teams call
3
u/No_Resolution_9252 Sep 04 '25
parameter sniffing
3
u/Megatwan Sep 04 '25
https://www.brentozar.com/first-aid/ SP blitz script have some handy drill down function as well
3
u/UltimateX29 Sep 04 '25
Amma say something completely different, Check with security team. Just grab one of them and threaten them and they'll confess what they did. All sudden issues are caused by them getting an admin privileges and monitor and inspect everything in the network.
I'll be damn sure it's their protection software installed on the server.
1
u/my-ka Sep 06 '25
can be workload volume
data volume
or a different query plan
i can look
1
u/LinkinNg Sep 08 '25
Maybe you can use Extended Events.
https://learn.microsoft.com/en-us/sql/relational-databases/extended-events/extended-events?view=sql-server-ver17
It is the replace of ย Profiler.
You can config to monitor every event/field, see every sql statement.
Then you can filter by column, sort descending(need stop data feed) by cpu_time/logical_reads.
0
u/jshine13371 6 Sep 03 '25 edited Sep 08 '25
Possibly due to some query regressions / change in execution plan. Could happen naturally as the data changes significantly enough over time.
But you're paying for the CPUs (by a lot when you consider licensing) regardless if they have 40% utilization or 60%, so might as well get your money's worth and put those CPUs to work. That change in utilization shouldn't really be concerning or worth researching IMO.
Edit: Silly downvotes when the first paragraph is a valid explanation, and the second paragraph is advice per Brent Ozar and is just straight logical anyway.
-2
u/Odd_Repair9120 Sep 03 '25
Use the profiler to see which queries consume the most, then try to tune the one that is executed the most times and the one that consumes the most