Blog Post

SQL Server Support Blog
1 MIN READ

High waits on CLR_MANUAL_EVENT and CLR_AUTO_EVENT

mssql-support's avatar
mssql-support
Iron Contributor
Jan 15, 2019
First published on MSDN on Feb 05, 2008

If you have a SQL CLR application, you may notice that waits on CLR_MANUAL_EVENT and CLR_AUTO_EVENT from sys.dm_os_wait_stats are very high.

This is normal and can be safely ignored because these waits reflect internal CLR runtime waits under normal conditions.  Since SQL as a CLR host implements synchronization mechanism, it is able to track these kinds of waits and exposes them via DMV.

The only exception when you need to pay attention to these two wait types is that you actually use unsafe assemblies and use CLR Event objects (ManualResetEvent or AutoResetEvent) yourself.  In other words, if you use ManualResetEvent and you code results in waiting on the object, the wait time will also be reflected in CLR_MANUAL_EVENT type.  The same is true for AutoResetEvent which will be reflected in CLR_AUTO_EVENT type.  But using these two objects will require explicitly creating the assembly in unsafe mode.

To summarize, if all your assemblies are created in safe mode and you see high waits on CLR_MANUAL_EVENT and CLR_AUTO_EVENT, you can safely ignore them.

Jack Li
Escalation Engineer


Updated Jan 15, 2019
Version 2.0
No CommentsBe the first to comment