I'm collecting data on the performance of our Microsoft SQL 2008 server in preparation for moving it to Azure. It's a very low load server (currently max concurrent transactions max out at 3), however, about once a day there's a CPU and hard drive activity spike for about 20-30 minutes. Transaction activity during this time is the same as other times, however, the buffer cache hit ratio drops to almost 0 at the beginning of this spike (returns to 99+% quickly). Free pages fluctuate during the spike and after the spike is done the number of free pages is higher than before. Any way to find out what might be causing this spike? Could this be some sort of garbage collection? Anything specific I could monitor via Performance Monitor to give me a better idea of what's going on?
Sql-server – CPU and Hard Drive Spike for 20-30 Minutes
monitoringperformancesql serversql-server-2008
Related Question
- SQL Server – Why Online Indexing Causes Blocking
- MySQL CPU & Memory Spikes
- Sql-server – throttle individual databases instances on one SQL Server 2005 box
- SQL Server 2012 – Buffer Cache Size and Page Life Expectancy
- Sql-server – What could be causing this rogue CPU spike on MS SQL Server running on EC2
- Sql-server – Cannot reclaim Index Unused Memory in In-Memory OLTP
Best Answer
This spike is almost certainly due to daily maintenance tasks - specifically, index rebuilds and
DBCC CHECKDB
. These are very resource-intensive operations. For instance, the buffer cache hit ratio change you mentioned is likely due to index rebuilds reading every page out of various indexes as they are processed.Look for SQL Server Agent jobs that are configured to start during this time period. You can see an overview of scheduled jobs on the instance by double-clicking "Job Activity Monitor" in SSMS under the SQL Server Agent node.
You can also check for Maintenance Plans under the "Management" -> "Maintenance Plans" node (also in SSMS).
In terms of cost-saving in the cloud, it's possible you could forego some, or all, of the index maintenance. One way to do this would be to use Ola Hallengren's Index and Statistics Maintenance procedure, which will skip rebuilds on indexes that are small or not-very-fragmented.