Most of your spikes appear to coincide with page faults. 4GBs is not enough for the OS and other services to run. I would suggest you change your max server memory to 110GB and reevaluate.
SQL Server 2019 High Number of Context Switches
I'm observing a quite high number of context switches on a SQL Server 2019 Enterprise. The SQL Server instance is part of an always on group with 3 nodes (one of them is a read only node). The instance where I'm observing the high number of context switches acts the the primary node. The secondary replica runs in synchronous commit mode while the read only replica runs in asynchronous commit mode.
The server version reports as:
Microsoft SQL Server 2019 (RTM-CU15) (KB5008996) - 15.0.4198.2 (X64) Jan 12 2022 22:30:08
Copyright (C) 2019 Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor)
The SQL Server runs as a Windows Server 2019 standard addition hosted in a virtual machine in VMWare with 18 cores and has 124 GB out of 128 GB memory assigned.
Max degree of parallelism is set to 8 while cost threshold for parallelism is set to 100.
SQL Sentry is used for monitoring and shows a high number of context switches while CPU load is moderate and number of waits is low.
Can anybody explain how I can find out what exactly is causing this "strange" behaviour?
SQL Server Other
1 additional answer
Sort by: Most helpful
-
AmeliaGu-MSFT 14,006 Reputation points Microsoft External Staff
2022-03-15T06:00:22.893+00:00 Hi JohannesMaly-3567,
Constantly high values of Context Switches/sec and Processor: % Processor Time are a clear indication of processor bottlenecks. Please refer to Troubleshoot high-CPU-usage issues in SQL Server which might be helpful.
And for Max Degree of Parallelism, please refer to the recommended value in the doc and you can do some tests to see if higher or lower settings are better for your workload.
Please also check this article about tuning cost threshold for parallelism.Best Regards,
Amelia
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.