- SQL Server 2012 SP1 (Enterprise Edition) - 11.0.3000
- Windows Server 2012 (SP0)
- OS - 160 GB RAM
- SQL - 100 - 140 GB Allocated Memory
- TempDB on Fusion I/O.
- MAX DOP = 8, OptimizeAdhocWorkload=True, OleAutomationEnabled=True.
We are currently seeing an issue on our live production platform whereby seemingly without trigger the Compiles/sec increases from around 10-20 to around 1000. Also, the plan cache (objects) drops completely from ~99% to around 3-5% and never increases. As a side-effect, CPU increases from ~20% to ~60% on average.
The issue has occurred once before (on the 12th Dec) and we saw the same symptoms. Alarmingly, at 12:00 on the 12/12/2012 we saw an almost instant drop in plan cache and the recompiles did the exact same thing and increased up to around 1100 that time. We resolved it previously by restarting the SQL Service.
We have an AlwaysOn configuration, utilising 6 SQL Instances (on individual nodes) into the solution, although our current database configuration only uses 2 Sync mirrors and 1 async mirror.
Looking into the compiles by running a trace, we can see that the compiles aren't database specific, although I think there might be a trend with stored procedures which utilise TempDB. Unfortunately, that could be a red herring as a lot of our stored procedures utilise tempdb!
I have tried to alter the memory allocations to see if that has any impact. We have also tried rebuilding all statistics and DBCC FREEPROCCACHE.
Any advice is greatly appreciated.