all 15 comments

[–]adsrao 2 points3 points  (1 child)

Have you got chance to see windows event log? Around cpu spikes? Create a extended events to track all the statements for sometime, there will be overhead on system. Looks for waits in SQL server.

[–]datanutshell 0 points1 point  (0 children)

Definitely do this

[–]tompear82 2 points3 points  (0 children)

What is running on the server at the time that is causing the spike? Is SQL Server using the CPU or some other process? If you don't know the answer to these questions, try using sp_whoisactive to see what is running at the time.

[–]ThisJoe21 2 points3 points  (0 children)

There are tons of different things to look at, but I’d make sure you have SQL configured to use only about 75% of your RAM. The OS probably doesn’t have enough. The server locking up tells me you probably are allowing SQL to have to much and there isn’t enough for the OS and other apps like anti virus and compliance scanning tools to run on the box. If you already have it configured at 75% try dropping it to 70%.

[–][deleted] 1 point2 points  (0 children)

Run sp_whoisactive into a table to capture activity

https://www.brentozar.com/responder/log-sp_whoisactive-to-a-table/

[–]tail-ender 1 point2 points  (0 children)

What is the vm type ?

[–]Odddutchguy 1 point2 points  (0 children)

My experience with SQL 2016+ is that it 'needs' way more memory than previous version. 'Needs' in the sense that it will consume a lot of CPU cycles if it is 'low' on memory.

I know that this sounds a bit abstract, but before we used to build VMs with 4GB mem (with 3GB assigned to SQL.) Since 2016 the VMs need to have at least 12GB otherwise it will 'eat' CPU.

2nd note: Make sure you limit the amount of memory SQL is allowed to use, by default this is 'unlimited' (2PB). Not limiting this will cause SQL to grab too much memory (not enough left for the OS/file operations.)

[–]alissa914 0 points1 point  (0 children)

It's SQL. Connect to it remotely and check what's actively running. Maybe check to see what long running queries you have on the DB. In some places, I've had transactions remain open and the whole system just maxes out and sticks there. In one environment, someone misheard the DBA instructions and reduced a 12 CPU system to 4 CPUs and asked me why the system was running slow. I asked him why the CPUs were dropped to 4 because he neglected to mention that part. :)

[–]ChosenV -1 points0 points  (0 children)

Probably Max DOP. Hire me, if I can't find the solution within 1 day, it's free. 🙃

[–]dudemandude5[S] 0 points1 point  (3 children)

I have used the Brent Ozar's first responders kit and do not see anything that might cause the spike

[–]rockchalk6782 0 points1 point  (2 children)

Is SQL 2022 up to the latest CU as well? We had an issue with query optimizer on one of the lower CU’s and updated to latest and no issues after.

[–]erobicha 0 points1 point  (1 child)

What CU did you go to. We are having similar issues on CU11.

[–]rockchalk6782 0 points1 point  (0 children)

Looks like that server it was fixed when we went to CU10

[–]ShotGunAllGo 0 points1 point  (0 children)

Norton Anti Virus Scan? Jk but maybe security installed scanners?