• subscribe
March 25, 2009 12:00 AM

Maximize Storage Performance

Increase performance without increasing costs
SQL Server Pro
InstantDoc ID #100893

Intelligently Manage Backups
Backups are a double-edged sword. Ideally, you want to back up large databases to premium disk to maximize throughput. The problem is that after your backups are finished, the only thing they require is lots of disk—and they can gobble up premium disk in a hurry. Because most full backups are done during off-peak hours, I typically recommend putting backups on non-premium disk when there isn’t enough premium disk space available. This approach allows backups to take up space only on non-premium disks, and when done during off-peak hours the performance overhead associated with using non-premium disk doesn’t have a big impact.

 

Another option for backups is a third-party compression backup agent. These are typically much cheaper than additional premium disk and provide the added benefit of decreasing recovery times. Off-box backups to an iSCSI SAN or a network file share can also be good options, but a good rule of thumb is to always have one or two days of complete backups, including full backups and logs, in easily accessible storage such as on the box in case of disaster. The last thing you want in an emergency is to wait while your backups are sucked over the wire on a 100 megabit or gigabit network.

 

Efficient Log File Management
Many SQL Server environments have only one RAID controller or one RAID array, which data and log files must share. Consequently, log files end up on premium disk and can devour lots of high-performance disk that they don’t need. For example, if you have a 100GB database that sees about 12GB of logged activity each day, you likely want a log file of about 25GB, enough to handle daily load and account for spikes in activity. This, in turn would consume 25GB of premium disk, but log file information is perfectly safe on lesser storage, such as a RAID 1 array. The net result is that you can end up wasting lots of premium disk if you're only backing up your log files on a daily basis—and backing up only once a day is a bad move from a recoverability standpoint anyhow.

 

Because log file backups and the associated truncation operation are extremely performant, using regular and frequent log-file backups can help maximize the amount of premium disk capacity available. For example, consider the typical workday schedule in Figure 2, where most updates and modifications happen during peak hours. In the case of the 100GB database mentioned earlier, implementing hourly backups of the log allows the log file to be only 4GB, a comfortable size, assuming roughly 1GB–2GB of modifications per hour during peak hours plus ample padding. Hourly backups allow completed transactions to be safely logged and backed up to non-premium disk, freeing more than 20GB of premium disk without sacrificing reliability or performance. On larger systems that are slowly growing over time, this approach, properly used, can reduce the need to purchase additional premium storage.

 

 

Figure 2: Usage versus time of day

 

More Performance, Less Money
Ultimately, managing disk performance can require effort, tuning, tweaking, and even educated guesses. It’s worth the effort, however: By using your existing resources creatively, you can maximize the efficiency of your expensive I/O subsystems, which in turn can boost SQL Server’s overall performance and save the money you'd otherwise spend to upgrade to a more expensive storage solution or purchase new storage.



ARTICLE TOOLS

Comments
  • Kevin
    3 years ago
    Apr 20, 2009

    It is interesting point that , from my understanding after reading your statement, several files in same filegroup which is in same disk will make better performance because SQL Server give assign threads to each of the files, so one thread per file instead of one thread per disk; is my understanding right?

  • Michael
    3 years ago
    Apr 07, 2009

    @dnewtontmw: I was actually going to take umbrage at your comment as (in my mind) the advice I gave clearly didn't work off the one-thread-per-CPU mind-set. (And, truth is, I hate that PSS post anyhow, because it does state that multiple files/filegroups CAN/DOES speed up perf, but spends so much time focused on other details that I think that MANY readers focus too much on the words 'Urban Legend' and wronfully assume that asynch IO can't be leveraged to drastically increase throughput.)

    At any rate.. after I got off my high-horse, I reread what I had written and realized that I sadly did step in it, as my analogy of using multiple files concludes with the statement "instead of forcing query execution to wait on a single thread to pull data from disk."... which clearly sounds wrong from a technical standpoint. (Still kind of scratching my head about what I meant or was thinking when I wrote that...so feel free to throw crap at me as I deserve it.)

    That said, the point is: the use of multiple files can facilitate asynchronicity by increasing available I/O bandwidth (or by helping to keep the I/O path from getting saturated).

  • Doug
    3 years ago
    Apr 01, 2009

    Note however that the "one thread per SQL Server file" is not true, per Microsoft. For details, see:

    http://blogs.msdn.com/psssql/archive/2007/02/21/sql-server-urban-legends-discussed.aspx

    You could get better performance if you had multple files and those files were all on separate spindles or RAID arrays, but that's just for I/O bandwidth, not multi-threading issues.

  • Michael
    3 years ago
    Mar 31, 2009

    @Marcos, glad you liked the article. And yeah, this was a very basic, or introductory, article. The primary purpose was to introduce basic notions of maximizing performance from a wide variety of angles - and to help DBAs think in terms of maximizing their high-performance disks by offloading as much non-essential work as possible off of them. Covering some of the more advanced (and less covered) features would be a blast too...

  • Marcos
    3 years ago
    Mar 30, 2009

    Good article on an already well documented aspect of SQL Server's systems.
    Isn't any new feature, or maybe a "not so clear" aspect that deserves attention? I know it is much easier to write about something that has a lot of reference on the web, but I believe that you could explore less documented features, I know it will require more time, but ,maybe, the article will be more useful.

You must log on before posting a comment.

Are you a new visitor? Register Here