Twitter

Follow SQLQuill on Twitter

Subscribe

MN Pass

SQL Database Data File Growth Performance Impact

I was On call this week and one of our databases files became over 90% full.  This is the threshold we set to alert us to manually expand any file.  We have autogrowth just in case, but we want to manually expand files after hours to avoid the performance impact on SQL server when expanding files.The question I had was do I wait for the maintence window, when services are shut off and no database activity is going on, or do I expand the file after business hours when there is minimun activity.  One of the things we’ve been working for is a maintenance window reduction, so for future reference, I needed to know what the performance impact was – not to mention the fact that the maintenance window is at 2 AM and with a baby, I wanted all the sleep I can get.Here’s what I’ve found – any data changes that cause a page split or an additional page will be suspended, pretty much everything else will work – a good explanation here - 

Any operation that depends on a new extent allocation will suspend while the data file is being expanded. If you are inserting on a non-full page, it will work. In-place updates will work.  New rows that trigger an extent allocation will suspend.   

So here’s what I did – I added 5Gb to the 700 in a non-peak time and it took 1 minute and 30 seconds.  During this time, I monitored for blocking, there was none.  My goal was to grow it 15 Gb total, so I repeated this process two more times. 

Performance Counters to Monitor for SQL

I would suggest once a quarter, set up a performance monitor log to collect the following counters for a couple of 24 hour periods.  Look at the results in both a graph and report forms to determine the peak usage times and to see if there are any bottlenecks on your SQL server.

Here are the counters to monitor:

Memory: Pages/sec
Average between 0 and 20
spikes ok
Memory: Availible Bytes
Average > 5 MB
SQL Server: Buffer Manager: Buffer Cache Hit Ratio
> 90 closer to 99
Physical Disk: Disk Reads/sec
Watch for Growth over time
value depends on hardward
Physical Disk: Disk Writes/sec
Watch for Growth over time
value depends on hardward
Physical Disk: % Disk time
< 55%
if > 55% for more than 10 minutes may be an issue
Physical Disk: Avg. Disk Queue Length
< 2*individual drive in an array
i.e. < 10 is ok for 5 disc raid)
if > for more than 10 minutes may be an issue
Physical Disk: % Free Space
> 15%
Logical Disk: % Free Space

> 15%
Processor: % Processor Time
< 80%
Spikes ok
if > 80% for more than 10 minutes may be an issue
System: Processor Queue Length
< 2 per CPU
if > 2 per CPU for more than 10 minutes may be an issue
Network Interface: Bytes Received/sec
A sudden unexpected increase could be an external attack
Network Interface: Bytes Sent/sec
A sudden unexpected increase could be large volume of information being accessed
Network Interface: Output Queue Length
< 2
If NDIS hardware – this should always be 0
SQL Server: General: User Connections
< 255
if > 255 for more than 10 minutes may be an issue

These are the basics, keep a report of the findings and compare them to past results each time you run them.