7
Overview SQL Server 2014 provides failover capability for databases between Windows Failover Cluster Service nodes using the AlwaysOn Availability Groups (AAG) feature. AAGs include two types of availability replicas: a single primary replica which hosts the primary databases, and one to eight secondary replicas, each hosting a set of secondary databases. These replicas serve as potential failover targets for the availability group. User applications that require one or more individual databases for their information store can now be grouped together and achieve failover and redundancy at the same time between replicas. AAGs use the Windows Server Failover Cluster (WSFC) feature to monitor quorum between nodes for failover policy. An additional witness server is no longer required to support failover, potentially saving costs and data center space. Failover can be configured for manual or automatic. The virtual network name is used to transfer ownership from a primary to secondary replica. Secondary replicas are active read-only databases that can also be used to offload workloads from the primary for reporting, analytics and backups. Multiple availability groups can be supported and there is no enforced limit as this is dependent on workload and server resources. These databases can be configured for synchronous or asynchronous mode. Availability Modes Synchronous Commit Mode: In this mode transactions are not committed on the primary replica until they have received confirmation the transaction has been hardened on the secondary replica transaction log. This ensures there is no data loss at the secondary replica but does create transaction latency. Asynchronous Commit Mode: In this mode transactions are committed and hardened to the primary replica transaction log without waiting for confirmation from the secondary replica. Transaction latency is minimal, however there is a risk of data loss at the secondary replica. This document focuses on using the synchronous commit mode to help ensure no data loss. Microsoft warns that this protection comes at the cost of increased transaction latency. However, careful selection of the products used for the server- to-server communication and database storage can help mitigate the overhead of using the synchronous mode. The use of flash-based storage can significantly reduce response times over using HDDs. Technology Paper Accelerate SQL Server 2014 AlwaysOn Availability Groups with Seagate ® Nytro Flash Accelerator Cards Authored by: Mark Pokorny, Database Engineer, Seagate

Accelerate SQL Server 2014 AlwaysOn Availability Groups ... · 7. Install SQL Server 2014 as a standalone instance on all servers that will participate in the WSFC SQL Server Availability

  • Upload
    others

  • View
    17

  • Download
    0

Embed Size (px)

Citation preview

  • Overview

    SQL Server 2014 provides failover capability for databases between Windows Failover Cluster Service nodes using the AlwaysOn Availability Groups (AAG) feature. AAGs include two types of availability replicas: a single primary replica which hosts the primary databases, and one to eight secondary replicas, each hosting a set of secondary databases. These replicas serve as potential failover targets for the availability group. User applications that require one or more individual databases for their information store can now be grouped together and achieve failover and redundancy at the same time between replicas.

    AAGs use the Windows Server Failover Cluster (WSFC) feature to monitor quorum between nodes for failover policy. An additional witness server is no longer required to support failover, potentially saving costs and data center space. Failover can be configured for manual or automatic. The virtual network name is used to transfer ownership from a primary to secondary replica.

    Secondary replicas are active read-only databases that can also be used to offload workloads from the primary for reporting, analytics and backups. Multiple availability groups can be supported and there is no enforced limit as this is dependent on workload and server resources.

    These databases can be configured for synchronous or asynchronous mode.

    Availability Modes

    • Synchronous Commit Mode: In this mode transactions are not committed on the primary replica until they have received confirmation the transaction has been hardened on the secondary replica transaction log. This ensures there is no data loss at the secondary replica but does create transaction latency.

    • Asynchronous Commit Mode: In this mode transactions are committed and hardened to the primary replica transaction log without waiting for confirmation from the secondary replica. Transaction latency is minimal, however there is a risk of data loss at the secondary replica.

    This document focuses on using the synchronous commit mode to help ensure no data loss. Microsoft warns that this protection comes at the cost of increased transaction latency. However, careful selection of the products used for the server-to-server communication and database storage can help mitigate the overhead of using the synchronous mode. The use of flash-based storage can significantly reduce response times over using HDDs.

    Technology Paper

    Accelerate SQL Server 2014 AlwaysOn Availability Groups with Seagate® Nytro™ Flash Accelerator Cards

    Authored by: Mark Pokorny, Database Engineer, Seagate

  • Problem DefinitionWorkload Analysis and Definitions

    A primary concern for database administrators is latency. User applications that depend on SQL Server as their information store require low latency service times for Online transaction processing (OLTP) workloads. SQL Server has a rich feature set to help identify bottlenecks known as Wait Statistics. This information can be viewed with Windows Perfmon Counters or SQL Server Dynamic Management Views.

    High Page I/O Latch times can be an indicator the storage subsystem is not able to meet the service requirements for a given SQL Server workload. This occurs when a page is being retrieved from disk into the SQL Server buffer pool memory.

    Paul S. Randal of SQL Skills writes:

    “Most SQL Servers today are I/O bound - that’s a generally agreed-on statement by DBAs and consultants in the field. This means that the major factor in server performance is its ability to perform I/O operations quickly. If the I/O subsystem cannot keep up with the demand being placed on it, then the SQL Server workload will suffer performance problems.”¹

    Solution Overview

    The Seagate Nytro flash accelerator card is a solid state primary storage solution for accelerating SQL Server workloads. The small PCIe foot print gives database administrators the option of easily transforming their storage subsystem to solid state storage.

    Features and benefits include:

    • In-box drivers for Windows Server 2012 R2

    • Average response times less than 50 microseconds

    • High throughput up to 4Gb/s on PCIe 3.0

    • SandForce® DuraClass™ technology for enterprise quality

    • All Microsoft drivers are WHQL qualified

    • Installs as a single drive—no user configuration

    Built with advanced solid state capabilities and technology that optimizes endurance and reliability, the Nytro card offers an enterprise ready solution. Using a host offload architecture implementation this solution reduces server CPU and DRAM dependency leaving these resources for the host and SQL Server Instance to utilize.

    Solution Details and Test ConfigurationSolution Components

    • Windows Domain

    • Windows Server 2012 R2 Failover Cluster Service

    • SQL Server 2014 Enterprise Edition

    • AlwaysOn Availability Groups (primary/secondary replica)

    • Seagate Nytro flash acceleration cards

    Solution Architecture using Nytro Flash Accelerator Card

    Figure 1 demonstrates SQL Server Availability Groups architecture with Nytro flash accelerator cards deployed.

    Accelerate SQL Server 2014 AlwaysOn Availability Groups with Seagate Nytro Flash Accelerator Cards

    Primary Site Secondary SiteSynchronized CommitAsynchronous CommitAuto Database Failover

    Active SecondaryLow Latency Storage

    Database Files Database Files

    SQLServer

    Nytro Flash Accelerator Card Nytro Flash Accelerator Card

    SQLServer

    Figure 1. Layout of the Tested Referenced Architecture

    1 How to examine I/O subsystem latencies from within SQL Server, SQL Skills Blog Post, April 11, 2011 Authored By Mark Pokorny, Database Engineer, Seagate

  • Tested Performance Metrics

    There are several key storage performance metrics (Figure 2) as well as SQL Server performance metrics, which are key to achieving a productive and accelerated SQL Server deployment. The storage performance metrics include IOPS, throughput and latency. When testing these metrics it is important that the comparisons in performance are made with the same I/O size: typically 8KB, 64KB or 512KB.

    Storage

    ApplicationRequests

    Read/WriteOperation

    Time

    Storage

    Time

    I/O BUSTime Time

    READ WRITE

    8KB

    64KB

    512KB

    IOPS Throughput Latency I/O Size

    The # of I/O requests satis�ed per unit of time which is an application request to a storage subsystem to perform a read or write operation.

    The amount of data per unit time actually moved across an I/O bus in the course of executing an I/O read or write operation.

    The time needed to complete a read or write operation from the initiation state to the completion state.

    The I/O request size by an applica-tion from a storage subsystem to perform a read or write operation.

    Figure 2. Storage Performance Metrics

    SQL Server performance metrics (Figure 3) include Page I/O Latch, database transactions and bytes sent to the replica database.

    ReplicaDatabase

    PrimaryDatabase Engine

    Delete

    Update

    Drop Select

    AlterTruncateInse

    rt

    Create

    Storage

    ReplicaDatabase

    SecondaryRequest for database pagenot in the memory buffer poolQueryResults

    UserQuery

    Remote Data Transfer

    Time

    Page I/O Latch Database Transaction Bytes Sent to Replica DB(primary to secondary)

    Time it takes to retrieve a page from Nonvolatile storage (disk, �ash) into Volatile storage DRAM (buffer pool).

    Operations that create a single logical unit of work.

    # of bytes sent to the remote availability replica per second. On the primary replica, this is the # of bytes sent to the secondary replica.

    Memory

    Figure 3.: SQL Server Performance Metrics

    Accelerate SQL Server 2014 AlwaysOn Availability Groups with Seagate Nytro Flash Accelerator Cards

  • Solution Implementation Steps

    To deploy the SQL Server 2014 AlwaysOn Availability Groups feature with the Nytro card, the following steps are typically used for implementing/testing this solution:

    1. Install the Nytro cards in the servers that participate in the Windows Server Failover Cluster (WSFC) SQL Server Availability Groups configuration.

    2. Configure local Windows volumes that correspond with the Nytro card storage.

    3. Join the servers to the Windows domain.

    4. Apply Windows updates to all servers.

    5. Create SQL Server domain accounts. (All Availability Groups need to be in the same domain).

    6. Ensure the .NET Framework 3.5 feature is enabled on all servers that will participate in the WSFC SQL Server Availability Groups configuration.

    7. Install SQL Server 2014 as a standalone instance on all servers that will participate in the WSFC SQL Server Availability Groups configuration.

    8. Review SQL Server 2014 Service Packs or updates on all instances that will participate in the WSFC SQL Server Availability Groups configuration and apply as recommended by Microsoft.

    9. Ensure the Windows volume drive letters that contain the associated database files that will participate in the WSFC SQL Server Availability Groups configuration are the same across all servers.

    10. Install the WSFC feature on each node that will participate in the WSFC SQL Server Availability Group configuration.

    11. Log into one of the servers that will participate in the WSFC SQL Server Availability Groups configuration with a domain account.

    12. Create a WSFC performing the necessary validation tests required (storage tests can be skipped).

    13. On each SQL Server instance that will participate in the WSFC SQL Server Availability Groups configuration, enable the AlwaysOn Availability Group feature for the MSSQLSERVER service.

    14. Restart each SQL Server instance that will participate in the WSFC SQL Server Availability Groups configuration.

    15. Identify databases that will participate in the WSFC SQL Server Availability Groups configuration. Databases must be configured for full recovery mode.

    16. On the primary node create full backups of the databases to participate in the WSFC SQL Server Availability Group configuration.

    17. On the primary node create log backups of the databases to participate in the WSFC SQL Server Availability Groups configuration.

    18. On the secondary node perform a database restore with the NORECOVERY option of the full backups.

    19. On the secondary node perform a transaction log restore with the NORECOVERY option of the log backups.

    20. Create the Availability Groups with Synchronous Commit mode using the join only option.

    NOTE: For more detailed information regarding installation/configuration of SQL Server 2014, and Windows Server platforms please see the applicable documentation listed at http://www.microsoft.com.

    Accelerate SQL Server 2014 AlwaysOn Availability Groups with Seagate Nytro Flash Accelerator Cards

    http://www.microsoft.com

  • Tested Configuration Overview

    The following components were used in this solution to measure metrics with and without using the card for SQL Server data and log files.

    Hardware

    Item Quanity Version Details/Notes

    Dell Server 2 R920 Power Edge Series

    Intel Xeon Processor 2 E7-4820 v2 Ivy Bridge-E/EP 2.0 GHz 8 physical cores

    Memory 16 DDR3 1600MT/s 128GB

    Dell PERC 2 H730P - Firmware version = 4.220.00-2997- Driver = Windows Server 2012 R2- Driver Version = 6.600.21.8

    Dell PERC Virtual Drive

    2 N/A - SQL Server Log File- Disks = 4- RAID Level = 10- Size = 557GB- Strip Size = 64KB- Disk Cache Policy = Disable- Read Policy = No Read Ahead - I/O Policy = Direct I/O- Current Write Policy = Write Back BBU- Default Write Policy = Write Back BBU- Current Access Policy = Read Write- Default Access Policy = Read Write

    Dell PERC Virtual Drive

    2 N/A - SQL Server Data File- Disks = 16- RAID Level = 10- Size = 2TB- Strip Size = 64KB- Disk Cache Policy = Disable- Read Policy = No Read Ahead - I/O Policy = Direct I/O- Current Write Policy = Write Back BBU- Default Write Policy = Write Back BBU- Current Access Policy = Read Write- Default Access Policy = Read Write

    Seagate® Nytro™ Flash Card Virtual Drive

    2 N/A - SQL Server Data File - SQL Server Log File- Size = 3.2TB- Interface = PCIe Gen 3.0- Firmware Package Version = 12.00.02.00 - Firmware Version = 112.00.51.00- Driver = Windows Server 2012 R2- Driver Version = 2.10.66.0- Formatting = Performance Over Provisioning

    Broadcom Network Card 8 NetExtreme - Gigabit Connection

    Software

    Item Quanity Version Details/Notes

    Windows Server 2012 R2 2 6.3.9600 Build 9600 Data Center Edition

    SQL Server 2014 2 12.0.2254.0- Enterprise Edition- Database Size = 772GB- Users = 100

    MegaRAID Storage Manager 2 14.05.02.00

    Accelerate SQL Server 2014 AlwaysOn Availability Groups with Seagate Nytro Flash Accelerator Cards

  • Best Practices / Configuration

    The following configuration best practices were used for the benchmark results that follow.

    SQL Server Parameter Configuration

    Min/Max Memory Configure based on operating system total. Configure buffer pool memory accordingly; leave at least 4GB for operating system.

    Local Security Policy Lock pages in memory. Assign privilege to SQL Server service account.

    Instant File Initialization Perform volume maintenance tasks. Assign privilege to SQL Server service account.

    Volume Assignment Separate volume/disks for Data, Log, and Tempdb.

    Operating System Parameter Configuration Notes

    Windows Updates Ensure Windows has the latest updates applied.

    Drivers Ensure the drivers are up to date.

    Page File Set manually and maximum size when possible.

    Volume Formatting Ensure Windows volumes are formatted with 64K allocation unit for SQL Server files.

    Power Management Configure for High Performance

    Server Parameter Configuration Notes

    BIOS Updates Ensure BIOS is up to date.

    BIOS Configuration Disable CPU power management throttling features.

    Storage Parameter Configuration Notes

    Firmware Ensure Firmware is up to date.

    Performance Results

    The following metrics were observed during the solution testing with a standard OLTP-type workload that consisted of 70% write and 30% read I/O operations. The storage performance results below (Figure 4) demonstrate that Nytro achieves improved performance. It is important to note that for some of these metrics, lower may be better as well.

    Figure 4. Storage Performance Metrics Results

    Accelerate SQL Server 2014 AlwaysOn Availability Groups with Seagate Nytro Flash Accelerator Cards

  • seagate.com

    AMERICAS Seagate Technology LLC 10200 South De Anza Boulevard, Cupertino, California 95014, United States, 408-658-1000 ASIA/PACIFIC Seagate Singapore International Headquarters Pte. Ltd. 7000 Ang Mo Kio Avenue 5, Singapore 569877, 65-6485-3888 EUROPE, MIDDLE EAST AND AFRICA Seagate Technology SAS 16–18, rue du Dôme, 92100 Boulogne-Billancourt, France, 33 1-4186 10 00

    © 2015 Seagate Technology LLC.. All rights reserved. Printed in USA. Seagate, Seagate Technology and the Spiral logo are registered trademarks of Seagate Technology LLC in the United States and/or other countries. Nytro, DuraClass and SandForce are either trademarks or registered trademarks of Seagate Technology LLC or one of its affiliated companies in the United States and/or other countries. All other trademarks or registered trademarks are the property of their respective owners. When referring to drive capacity, one gigabyte, or GB, equals one billion bytes and one terabyte, or TB, equals one trillion bytes. Your computer’s operating system may use a different standard of measurement and report a lower capacity. In addition, some of the listed capacity is used for formatting and other functions, and thus will not be available for data storage. Actual data rates may vary depending on operating environment and other factors. The export or re-export of Seagate hardware or software is regulated by the U.S. Department of Commerce, Bureau of Industry and Security (for more information, visit www.bis.doc.gov), and may be controlled for export, import and use in other countries. Seagate reserves the right to change, without notice, product offerings or specifications. TP675.1-1503US, March 2015

    The following is the average results for the SQL Server performance metrics (Figure 5).

    Figure 5. SQL Server Storage Performance Metrics

    Using SQL Server with a Nytro card lowers SQL Server wait times, improves latency, and transaction throughput for Availability Group configurations.

    Conclusion

    Reducing SQL Server wait times and application latency are high priorities for database administrators. The Seagate Nytro flash accelerator card used with SQL Server 2014 AAGs provides database administrators another option for meeting their objectives with high performance and ease of use compared to traditional shared storage solutions.

    Accelerate SQL Server 2014 AlwaysOn Availability Groups with Seagate Nytro Flash Accelerator Cards

    http://www.seagate.com