You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Incorrect Offline CPUs and NUMA Node count reported due to DAC / Internal Schedulers #5656
In the CPU / Scheduler metrics panel, the tool incorrectly reports Offline CPUs: 1 and NUMA Nodes (online / total): 3 / 4 on an instance with 24 online logical CPUs across 3 NUMA nodes, treating the DAC or internal scheduler as an offline resource.
Steps to Reproduce
Run Performance Monitor Lite on CPU scheduler Tab
Check the CPU / Scheduler metrics table.
Observe the reported Offline CPUs and NUMA Nodes (online / total) metrics.
Expected Behavior
NUMA node count should only count user NUMA nodes (excluding internal node 64 / DAC) or filter by parent_node_id < 64.
Offline CPUs should strictly evaluate offline user schedulers (e.g., status = 'VISIBLE OFFLINE' or excluding DAC scheduler_id = 1048576).
Actual Behavior
Reports Offline CPUs: 1
Reports NUMA Nodes (online / total): 3 / 4
Even though all 24 logical CPUs (cpu_id 0-23 across nodes 0, 1, 2) are fully online and VISIBLE ONLINE in sys.dm_os_schedulers.
Error Messages / Log Output
-- Query checking schedulers confirming all 24 are online:
SELECT
parent_node_id AS Numa_Node_ID,
scheduler_id,
cpu_id,
status,
is_online
FROM sys.dm_os_schedulers
WHERE status LIKE 'VISIBLE%' OR is_online = 0;
Triage notes for the agent who picks this up. The report is right, and the defect is wider than one box. The formula counts the DAC node as an offline node on every SQL Server instance. So every instance shows at least "Offline CPUs: 1" and one extra NUMA node. Nobody has changed any code yet.
Code read on dev at 2d9709215.
Where the defect is
PerformanceMonitor.Collectors/CpuSchedulerStatsCollector.cs, the nodes derived table (lines 173 to 197) and offline_cpu_count (line 154). This is the shared collector, so Lite and Darling both get the wrong values.
install/17_collect_cpu_scheduler_stats.sql has the same SQL (lines 183 and 211 to 221), for the Dashboard. The Dashboard is on bug-fix support, so fix it too.
The SQL has been the same since v1.0.0.
Three faults
The DAC node is excluded by the wrong id. The filter is n.node_id <> 32767. The DAC node's id is 64. The reporter's scheduler query shows the DAC scheduler (1048576, VISIBLE ONLINE (DAC)) on parent_node_id 64.
"Online" is an exact match. The query counts a node as online only when node_state_desc = N'ONLINE'. The sys.dm_os_nodes docs say that the state combines values: one of ONLINE, OFFLINE, IDLE and IDLE_READY, and then DAC, THREAD_RESOURCES_LOW or HOT ADDED. So the DAC node ("ONLINE DAC") counts as offline. So would an IDLE node, or a node that is low on thread resources.
"Offline CPUs" counts nodes, not CPUs.offline_cpus adds 1 for each node that is not exactly ONLINE. The warning flag offline_cpu_warning uses another rule: schedulers with is_online = 0. So the count and the flag disagree. That is why the reporter's 1 is not highlighted. The Dashboard's debug message (line 396 of the install script) also prints the node count as "offline nodes".
Reproduction
On a local SQL Server 2025 container with nothing offline, sys.dm_os_nodes returns node 0 ONLINE, node 1 ONLINE and node 64 ONLINE DAC. The collector's nodes query returns total_nodes 3, online_nodes 2 and offline_cpus 1.
Candidate fix
I checked this read-only on the same container. It returned 2 of 2 nodes online and 0 offline CPUs.
/* Nodes: leave out the DAC node by its state, and count every state except OFFLINE as online. */SELECT
total_nodes = COUNT_BIG(*),
online_nodes =SUM(CASE WHEN n.node_state_desc NOT LIKE N'OFFLINE%' THEN 1 ELSE 0 END)
FROMsys.dm_os_nodesAS n
WHEREn.node_state_desc NOT LIKE N'%DAC%';
/* Offline CPUs: count the schedulers that SQL Server has taken offline. */SELECT
offline_cpus = COUNT_BIG(*)
FROMsys.dm_os_schedulersAS s
WHEREs.status= N'VISIBLE OFFLINE';
Drive offline_cpu_warning from the same scheduler count, so that the count and the flag always agree.
Not tested: a box with an affinity-masked CPU or an offline node. A test should cover a node state with a combined value and the DAC node.
No schema change. The column names stay the same and only the values change. Rows that are already stored keep the old values.
The readers need no change: PerformanceMonitor.Common/CpuSchedulerMetrics.cs (lines 52 and 53), the Darling viewer, and the Lite MCP tool's offline_cpu.
Activity
nashalj commentedon Oct 11, 2026
erikdarlingdata commentedon Oct 11, 2026
Claude posting for Erik Darling.
Triage notes for the agent who picks this up. The report is right, and the defect is wider than one box. The formula counts the DAC node as an offline node on every SQL Server instance. So every instance shows at least "Offline CPUs: 1" and one extra NUMA node. Nobody has changed any code yet.
Code read on
devat2d9709215.Where the defect is
PerformanceMonitor.Collectors/CpuSchedulerStatsCollector.cs, thenodesderived table (lines 173 to 197) andoffline_cpu_count(line 154). This is the shared collector, so Lite and Darling both get the wrong values.install/17_collect_cpu_scheduler_stats.sqlhas the same SQL (lines 183 and 211 to 221), for the Dashboard. The Dashboard is on bug-fix support, so fix it too.Three faults
n.node_id <> 32767. The DAC node's id is 64. The reporter's scheduler query shows the DAC scheduler (1048576,VISIBLE ONLINE (DAC)) onparent_node_id64.node_state_desc = N'ONLINE'. The sys.dm_os_nodes docs say that the state combines values: one of ONLINE, OFFLINE, IDLE and IDLE_READY, and then DAC, THREAD_RESOURCES_LOW or HOT ADDED. So the DAC node ("ONLINE DAC") counts as offline. So would an IDLE node, or a node that is low on thread resources.offline_cpusadds 1 for each node that is not exactlyONLINE. The warning flagoffline_cpu_warninguses another rule: schedulers withis_online = 0. So the count and the flag disagree. That is why the reporter's 1 is not highlighted. The Dashboard's debug message (line 396 of the install script) also prints the node count as "offline nodes".Reproduction
On a local SQL Server 2025 container with nothing offline,
sys.dm_os_nodesreturns node 0ONLINE, node 1ONLINEand node 64ONLINE DAC. The collector'snodesquery returnstotal_nodes3,online_nodes2 andoffline_cpus1.Candidate fix
I checked this read-only on the same container. It returned 2 of 2 nodes online and 0 offline CPUs.
offline_cpu_warningfrom the same scheduler count, so that the count and the flag always agree.PerformanceMonitor.Common/CpuSchedulerMetrics.cs(lines 52 and 53), the Darling viewer, and the Lite MCP tool'soffline_cpu.Review round 1 for #5656: collection_log text, lite CI filter for ins…
Count offline CPUs and NUMA nodes correctly in the CPU scheduler coll…
erikdarlingdata commentedon Oct 11, 2026
Fixed on dev by #5657 (3aa8d76). Claude posting for Erik Darling.