Home > SQL Server Tips > Database Administration > How to configure storage in SQL Server database with more writes than reads
SQL Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DATABASE ADMINISTRATION

How to configure storage in SQL Server database with more writes than reads


Denny Cherry, Contributor
11.25.2008
Rating: -4.33- (out of 5)


Expert advice on database administration
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Configuring a database system with high writes requires some different techniques than configuring a traditional SQL Server system. Sometimes simply working with the SAN cache will do the trick and yield the best performance. But what about those times when RAID 10 is a requirement? SQL Server MVP Denny Cherry walks you through the steps for setting up a high write database system, including RAID array, cache configuration and file disk layout.


After publishing my tip about disk storage and tuning SQL Server performance via disk arrays and disk partitioning, I received a few comments about how RAID 10 was better for databases than RAID 5. The point was made that RAID 10 supports more writes per disk than RAID 5 because RAID 5 requires calculating the parity bit. When you look at the raw numbers between RAID 5 and RAID 10, that's right: RAID 10 will handle more writes than a RAID 5 array.

But when working in a large enterprise environment you are probably working with SANs and a lot of SAN cache. You can often work with that SAN cache to get the best possible performance out of your database writes by writing to the cache and having the SAN later flush to disk.

However, there is a portion of databases out there for which even this advanced
More on SQL Server storage and performance:
  • Webcast: Configuring SQL Server on SANS
  • Monitor SQL Server disk I/O with PerfMon counters
  • Tuning performance via memory and CPU processing
  • SAN configuration for SQL Server isn't enough to keep up with the writes – and where RAID 10 is a requirement. While these systems are not the norm, they are becoming more prevalent.

    Most databases have a record written once and then read, and many times the data is written once but rarely read until it is archived or deleted. These systems require a much more robust disk subsystem than your average database system.

    RAID array layout

    When designing high write database systems, you should look to some of the same basic techniques as a normal database server – with a few tweaks. You will still want to put your database, indexes, logs and tempdb database on separate physical disks from each other. The big difference here is that you want to configure all your RAID arrays as RAID 10, instead of putting your database and indexes on RAID 5 arrays.

    You will still want to configure at least one data file for database files per 4 CPU cores. You may wish to consider having one data file per 2 CPU cores. Your index file group should be set up in the same way as your data file group, and the tempdb should have at least one data file per 2 CPU cores.

    Cache configuration

    When dealing with these high write database systems, pay special attention to the cache settings on the LUNs or JBOD RAID arrays. When your system is mostly write, your read cache is mostly unnecessary. If possible, you should disable – or at the minimum, change – the cache settings to somewhere around 10/90 read/write or 20/80 read/write. This optimizes the amount of data the disk subsystem will accept before it has to be written directly to the disk because the cache is full.

    If your disk storage subsystem gives you the option, adjust the high and low watermarks that tell the disk subsystem how much data can get into the write buffer before it starts writing this data to the disk.

    By adjusting these settings, using an EMC CLARiiON as an example system, we can see how much additional cache we can have for our LUN:

    Default Setup Adjusted Setup
    Cache Ratio (R/W) 50/50 10/90
    Total SP Cache 3 Gigs 3 Gigs
    Dedicated To LUN 300 Megs 300 Megs
    Size of Read Cache 150 Megs 30 Megs
    Size of Write Cache 150 Megs 270 Megs

    With this small setting change, you have greatly increased the amount of data that can be written to the write cache before it fills. This allows SQL Server a much greater amount of writing (~40% more writing) that can be done at high speed before having to slow to allow the storage to clear the cache.

    File to disk layout

    When laying out physical files, you'll want to structure one physical file per RAID array. When you start working with this configuration, you can quickly run out of drive letters. When that happens, use mount points to present the additional disks to the system. Mount points are disk volumes that are mounted as folders on other physical disks. You access the data through the same drive letter, but the disks are independent of each other and have separate I/O capacity, which allows you to host more than 26 physical drives on a single server.

    While the basic techniques are similar, configuring a very large high write database does require some different techniques than a normal SQL Server system.


    ABOUT THE AUTHOR:   
    Denny Cherry has over a decade of experience managing SQL Server, including MySpace.com's over 175-million-user installation, one of the largest in the world. Denny's areas of expertise include system architecture, performance tuning, replication and troubleshooting. Denny uses these skills in his current role as a Sr. Database Administrator and Architect at Awareness Technologies. He currently holds several Microsoft certifications related to SQL Server and is a Microsoft MVP. He is a member of PASS and Quest Software's Association of SQL Server Experts and has written numerous technical articles on SQL Server management.
    Check out his blog: SQL Server with Mr. Denny

    MEMBER FEEDBACK TO THIS TIP

    Do you have a comment on this tip? Let us know.


    Rate this Tip
    To rate tips, you must be a member of SearchSQLServer.com.
    Register now to start rating these tips. Log in if you are already a member.


    Submit a Tip




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



    RELATED CONTENT
    Microsoft SQL Server Performance Monitoring and Tuning
    SQL Server Mailbag: CALs, witnesses and unwanted changes
    SQL Server Mailbag: Data restoration and DB property management
    Working with IntelliSense in SQL Server 2008 Management Studio
    SQL Server Mailbag: Stored procedures, triggers and SSRS reports
    Troubleshooting Distributed Transaction Coordinator errors in SQL Server
    Clearing the Windows page file and its effect on server performance
    Optimizing SQL Server indexes –- even when they're not your indexes
    Performance implications of transaction log autogrowth in SQL Server
    The short course on how SQL Server really works
    Determining the source of full transaction logs in SQL Server

    SQL Server High Availability, Scalability and Reliability
    Are data warehouses made for the cloud?
    Top load balancing methods for SQL Server
    Maintaining high availability of SQL Server virtual machines
    Creating fault-tolerant SQL Server installations
    Scaling up vs. scaling out with SQL Server 2008
    SQL Server database replication tutorial
    Licensing a standby server for SQL Server replication
    Get SQL Server log shipping functionality without Enterprise Edition
    Monitor database mirroring and replication after a SQL Server upgrade
    Upgrade live applications to SQL Server 2005 for high availability
    SQL Server High Availability, Scalability and Reliability Research

    Database Administration
    Hardening the network and OS for SQL Server security
    Securing the server and database in SQL Server
    How SQL Server 2008 components impact SharePoint implementations
    Troubleshooting Distributed Transaction Coordinator errors in SQL Server
    Achieving high availability and disaster recovery with SharePoint databases
    Clearing the Windows page file and its effect on server performance
    Deploying a SQL Server virtual appliance for Microsoft Hyper-V
    How to create SQL Server virtual appliances for Hyper-V
    Push vs. pull: Configuring SQL Server replication
    Setting up SQL Server Service Broker for secure communication

    RELATED GLOSSARY TERMS
    Terms from Whatis.com − the technology online dictionary
    contiguity  (SearchSQLServer.com)
    contiguous  (SearchSQLServer.com)
    drilldown  (SearchSQLServer.com)
    hashing  (SearchSQLServer.com)
    hybrid online analytical processing  (SearchSQLServer.com)

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



    SQL Server Development - .NET, C#, T-SQL, Visual Basic
    HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts