- Newest
- Most votes
- Most comments
This is a fascinating and well-documented troubleshooting case. Based on the symptoms you've described—particularly the RESOURCE MONITOR thread consuming significant CPU with PREEMPTIVE_XE_CALLBACKEXECUTE wait types and a preemptive worker with MEMORY_ALLOCATION_EXT waits—here are some insights:
-
PREEMPTIVE_XE_CALLBACKEXECUTE at high frequency: This wait type indicates Extended Events callback execution happening outside the SQL Server scheduler. Even though both instances run only the default XE sessions (hkenginexesession and system_health), the affected instance is firing callbacks at 2,400/s while the control fires zero. This suggests something is triggering excessive event captures or processing within those sessions. Check if there are differences in the XE session configurations themselves—specifically the event predicates, targets, or buffer settings. Even subtle differences in what events are being captured (especially high-frequency events like statement completions or memory allocations) could cause this behavior. The RESOURCE MONITOR thread may be spending excessive time processing these events.
-
RESOURCE MONITOR at 44% CPU: The RESOURCE MONITOR is a system thread responsible for monitoring memory pressure, detecting deadlocks, and other health checks. When it shows high CPU with steady physical memory usage, it may be repeatedly evaluating memory conditions or processing internal notifications. The extremely high context switch count (1.375 billion) on this thread is abnormal and suggests it's being awakened very frequently—possibly by the same mechanism driving the XE callbacks. This could indicate an internal feedback loop where memory allocation events trigger XE callbacks, which in turn cause more monitoring activity.
-
Version-specific behavior (16.00.4185.3 vs 15.00.4480.2): You're running SQL Server 2022 (16.00.4185.3) on the affected instance versus SQL Server 2019 (15.00.4480.2) on the control. This is a significant difference. SQL Server 2022 introduced numerous internal changes to memory management, Extended Events, and system monitoring. There could be a version-specific issue or behavioral change in how the RESOURCE MONITOR interacts with Extended Events in SQL Server 2022. Consider checking if there are newer cumulative updates available for your SQL Server 2022 version that might address internal performance issues. You can use the AWS CLI to check available upgrade targets for your engine version.
-
Diagnosing the preemptive worker: Without access to memory dumps or deeper diagnostics, options are limited. However, you could try temporarily disabling the Extended Events sessions (even the default ones, if RDS permits) to see if the CPU drops. If you can stop system_health temporarily, this would confirm whether XE processing is the root cause. Additionally, monitor sys.dm_os_memory_clerks to see if any memory clerk is showing unusual activity that might correlate with the MEMORY_ALLOCATION_EXT waits.
Additional suggestions:
-
Since the behavior is reversible after reboot and recurs, consider whether there's a specific workload pattern, connection behavior, or scheduled job that triggers the condition. The fact that it started in early August and became continuous in mid-September suggests an environmental or workload change.
-
Compare the exact Extended Events session definitions between the two instances using sys.server_event_sessions and related DMVs. Even if both show the same sessions, their internal configurations might differ.
-
If you haven't already, consider upgrading the affected instance to a newer SQL Server 2022 cumulative update to rule out known issues.
-
For deeper investigation, you may need to engage AWS Support through the AWS Support Center to analyze RDS-level metrics and potentially capture diagnostics that aren't accessible through standard SQL Server DMVs.
This appears to be an internal SQL Server engine issue, possibly version-specific, where the monitoring and Extended Events subsystems are in an inefficient state. The reversible nature suggests it's not corruption but rather a runtime condition that can be triggered and cleared.
Sources
Major version upgrades for RDS for SQL Server - Amazon Relational Database Service
Relevant content
asked 3 years ago
asked 5 years ago
