Four waits cover CLR assemblies loading and CLR tasks starting, and this page covers them together:
ASSEMBLY_LOAD: Microsoft describes it as exclusive access to assembly loading.ASSEMBLY_FILTER_HASHTABLE: internal use only, from SQL Server 2016; inserting into or iterating a hash table of hash values used by CLR.CLR_CRST: a task in CLR execution waiting to enter a critical section that another task is using.CLR_TASK_START: waiting for a CLR task to complete startup.
Are They a Problem?
Rarely. None of them is a known contention point. Get Wait Statistics does not filter them out. Assembly loading clusters at first use and after an application domain restarts, so a burst of ASSEMBLY_LOAD usually means a domain cycled, which SQLCLR_APPDOMAIN and the error log’s unload messages confirm.
When They Do Matter
CLR_CRST is the one with a code angle. If it grows, look at whether a thread can stay in a critical section of your own CLR code for a long time. That is a review of the assembly, with external calls kept out of held sections. The baseline to monitor is the error log’s application domain unload messages staying rare.
The CLR Family
These are the SQL CLR waits: CLR worker threads idling, and the work of loading assemblies and application domains. Most are commonly filtered as benign. If one is near the top of your waits, start from the waits that usually matter instead.
- CLR_AUTO_EVENTAuto-reset event. A CLR task waiting on an auto-reset event; long waits are typical.Usually noise
- CLR_MANUAL_EVENTManual-reset event. A CLR task waiting on a manual-reset event.Usually noise
- CLR_SEMAPHORESemaphore. A CLR task waiting for a semaphore.Usually noise
- SQLCLR_APPDOMAINApp domain startup. Waiting for a CLR application domain to finish starting.Worth a look when it climbs
- SQLCLR_ASSEMBLYAssembly list. Waiting for access to the loaded assembly list in the app domain.Usually noise
- ASSEMBLY_LOAD and assembly waitsAssembly loading. Exclusive access while an assembly loads.Usually noise. This page.
Where To Go Next
These assembly waits are usually small. If you are chasing a real problem, start with the waits that cost you time.
- The waits that usually matter, ranked, with what each one is telling you.
- Performance & Troubleshooting, the scripts and guides for this part of the stack.
Leave a Reply