38
www.SanDisk.com 951 SanDisk Drive, Milpitas, CA 95035 Improve Business Productivity and User Experience with a SanDisk® Powered SQL Server 2014 In-Memory OLTP Database WHITE PAPER

Improve Business With SQL2014 Dell WP

Embed Size (px)

DESCRIPTION

Improve Business With SQL2014 Dell

Citation preview

www.SanDisk.com 951 SanDisk Drive, Milpitas, CA 95035Improve Business Productivity andUser Experience with a SanDisk PoweredSQL Server 2014 In-Memory OLTP DatabaseWHITE PAPER Improve Business Productivity and User Experience 2Table of ContentsExecutive Summary ........................................................................................................................................................................ 3Introduction: In-Memory Meets Fusion ioMemory .................................................................................................................... 4What Is In-Memory OLTP? ........................................................................................................................................................................................ 4Unleash SQL Server 2014 In-Memory OLTP Database From I/O Constraints .......................................................................................5Eliminate Continuous Checkpoint Slowdowns ............................................................................................................................................5Improve HA and Maintenance by Accelerating Reboots, Restarts, and Failovers .........................................................................5About the Tests ............................................................................................................................................................................... 6Server Conguration ................................................................................................................................................................................................... 6Storage Conguration ................................................................................................................................................................................................ 6Operating System Conguration ............................................................................................................................................................................7SQL Server 2014 Conguration: Dell PowerEdge R720 .................................................................................................................................7Workload Conguration .............................................................................................................................................................................................7Test Results ..................................................................................................................................................................................... 840GB In-Memory OLTP Transactional Workload Test Results ....................................................................................................................8Overall Performance ..............................................................................................................................................................................................8Memory-Optimized Filegroup Performance ................................................................................................................................................ 9Transaction Log Performance ..........................................................................................................................................................................10Database Startup Tests ............................................................................................................................................................................................. 12Database Startup Performance ....................................................................................................................................................................... 12Scaling Beyond 12,000 Users ................................................................................................................................................................................. 13Summary .........................................................................................................................................................................................14Appendix A: Is SQL Server In-Memory OLTP Right for You? .................................................................................................. 15Table Usage Analysis ................................................................................................................................................................................................ 25Table Contention Analysis ................................................................................................................................................................................ 27Stored Procedure Usage Analysis.................................................................................................................................................................. 28Memory Optimization Advisor ........................................................................................................................................................................ 29Native Compilation Advisor ................................................................................................................................................................................... 36 Improve Business Productivity and User Experience 3Executive SummaryThere has been a lot of press recently about in-memory databases, and with good reason: business user requests served from memory are lightning-fast. An in-memory database can easily process an order of magnitude more transactions per day, and is therefore capable of order of magnitude greater business productivity. SQL Server In-Memory OLTP allows specic key tables to be memory-optimized while maintaining the investment in the T-SQL code base. SQL Server In-Memory OLTP shows dramatic performance increases in a typical system and allows business users to choose which business objects should be placed in memory, based on critical need.This paper shows how combining Fusion ioMemory products with SQL Server In-Memory OLTP improves the customer experience even more. It does this by improving system response time and business productivity (transactional processing capabilities), allowing more customers to be served per server, all the while dramatically reducing costs compared to traditional storage solutions.The following table summarizes results of performance testing performed by SanDisk on a Dell PowerEdge R720 and validated by Microsoft. Business Value Key PerformanceIndicators Enterprise-Class Disk Array with 2014 SQL ServerIn-Memory OLTPioDrive2 Duo 2.4TB with SQL Server 2014 In-Memory OLTP Business ProcessImprovementImprove CustomerExperience User Transaction Wait Time () 1329 117Reduced user wait timesby 91%Serve More Customers Transaction Throughput (MB/s) 42 172Increased throughputby 409%Improve BusinessProductivityTotal Transactions Processed(over 45 minutes)6,362,883 28,328,639Processed 445%more transactionsDeliver on Internal Service Level AgreementsDatabase Startup Time (sec) 222 72Reduced startup timeby 67% Improve Business Productivity and User Experience 4Introduction: In-Memory Meets Fusion ioMemoryWhile SQL Server 2014 In-Memory OLTP brings never-before-seen performance levels and capabilities to SQL Server databases, these new capabilities require a storage subsystem that delivers consistent low latency, ultra-high bandwidth, and strong reliability. Backing SQL Server In-Memory OLTP databases with Fusion ioMemory products is critical in driving the highest transaction performance levels. This is done with the simplest, most cost-efective approach, compared to legacy storage architecture.What Is In-Memory OLTP?In-Memory OLTP is a memory-optimized database engine for SQL Server 2014. In-Memory OLTP enables transactional database applications to signicantly improve transactional throughput by providing contention-free access to tables, by way of native code.Other In-Memory database platform oferings often require re-tooling application code. This could be due to the need for deploying a new data access method, or even having enough RAM to house the entire database. SQL Server 2014 does not require the entire database to be placed into RAM the developer can choose which tables would benet the most from becoming memory-optimized tables. While there are some restrictions as to data types that may be a part of a memory-optimized table, the base data types are supported. Stored procedures that access the selected memoryoptimized tables may be compiled into native code, which executes faster. The end result is that much of the T-SQL code can be leveraged, taking advantage of new SQL Server In-Memory OLTP paradigms where the most value can be gained.Even when there is enough RAM in the server to hold the entire database in memory, SQL Servers access mechanism still operates on the concept of a page of data. It goes through the process of latching and locking to ensure data consistency. SQL Server In-Memory OLTP has an optimistic approach to concurrency. There is no latching or locking, but there is a mechanism to detect conict based on row versioning. Also, there is no longer a concept of a page of data within the SQL Server In-Memory data structures. With no pages to latch or lock, there is a signicant improvement in performance, as there is no waiting on resource availability and execution is unleashed. Improve Business Productivity and User Experience 5Unleash SQL Server 2014 In-Memory OLTP Database From I/O ConstraintsNo matter how powerful the database system, performance will always be limited at some point by chokepoints and bottlenecks. Fusion ioMemory products resolve several I/O bottlenecks to raise the bar on capabilities for SQL Server 2014 In- Memory OLTP database.ELIMINATE CONTINUOUS CHECKPOINT SLOWDOWNSTo ensure durability, SQL Server In-Memory OLTP relies heavily on the NTFS le system to store data and delta les in a database le group optimized for in-memory data. SQL Server In-Memory OLTP uses an ofine checkpoint process to track and manage inserted and deleted data. This generates a considerable amount of sequential disk I/O activity and increases transaction log activity.Write performance is key as transaction log activity is increased. This is due to the highly concurrent, contention-free transactions generated in memory. Fusion ioMemory products direct-path architecture provide industry-leading, near-DRAM write performance, which is often overlooked when discussing ash storage. This architecture enables performance more efectively than SSDs do, because SSDs place traditional storage protocols and RAID controllers between the data and the application, making it much more difcult to deliver consistent write performance.IMPROVE HA AND MAINTENANCE BY ACCELERATING REBOOTS, RESTARTS, AND FAILOVERSIn addition to the continuous checkpoint process, SQL Server In-Memory OLTP benets by reading data in parallel. The parallel read process happens a) when loading data from the data and delta les into memory during a server reboot, b) when restarting the SQL Server service, or c) when setting the database ofine. This process generates random I/O and relies on a high-performing disk subsystem to load tables into memory. The closer the data is to the CPU, the faster it will load into memory. As with the continuous checkpoint, Fusion ioMemory products direct-path architecture gives the database server CPUs direct access to the data and delta les, which accelerates reboots, restarts, and failover processes. Improve Business Productivity and User Experience 6About the TestsTesting compared performance of an ioDrive2 Duo 2.4TB card in a Dell PowerEdge R720 server to an enterprise-class disk array in three key areas:1.Transactional Performance. How the two systems performed under the heavy I/O workload generated by the in-memory transaction log activity and continuous checkpoints. Tests were conducted on latency (responsiveness), and bandwidth (transactional workload) with 12,000 users.2.Database Startup. As the database is running out of memory on servers, loading the database quickly becomes a key factor in system resilience. We tested how fast the transactional database could be brought online to compare how the two systems would handle a server reboot or cluster failover event.3.User Load. Tests were limited to 12,000 users because, at that point, the disk array started experiencing timeouts. Additional testing measured the total user load of a Fusion ioMemory system to demonstrate an additional aspect of scalability.Server CongurationThe following settings were enabled in the BIOS:Logical Processor was enabled. With Hyper-threading enabled, we were able to increase the number of users by 8000 in further testing.System Prole Settings was set to performance.Virtualization was disabled.Fan Ofset was set to high.Node Interleaving was disabled.Storage CongurationOne ioDrive2 Duo 2.4TB card was used as the storage for the in-memory database within the Dell R720 server. The ioDrive2 Duo product appears as two physical block devices to the host operating system. One block device was used for the memory-optimized legroup and disk-based legroup. The remaining block device was used exclusively for the transaction log. The enterprise class storage array was congured with two storage pools. The rst storage pool was comprised of 12 spindles and was used to store the memory-optimized le group, the disk-based data les, and tempdb. The second storage pool was comprised of 12 spindles and was used exclusively for the in-memory database transaction log. Improve Business Productivity and User Experience 7Figure 1. Storage layout of enterprise class disk array and Fusion ioMemory ioDrive2 Duo 2.4TB card. Note: Neither tempdb nor the disk-based tables were accessed during testing. All tables were marked for in-memory use.Operating System CongurationWe used the Interrupt-Afnity Policy Tool to bind the ioDrive2 card interrupts to CPU0. The Interrupt-Afnity Policy Tool can be found at http://msdn.microsoft.com/en-us/windows/hardware/gg463378.SQL Server 2014 Conguration: Dell PowerEdge R720Name Baseline Values Fusion ioMemory ValuesTransactional Database data les1 per core1 per core Tempdb data les1 per core1 per core Max Degree of Parallelism 1 1Min/Max Server Memory (MB) 256,000 256,000Lock Pages in MemoryEnabled EnabledWorkload CongurationA custom benchmark application generated a transactional workload on the systems. The benchmark application was congured with the following parameters.Parameter ValuesDuration 45 minutesIn-Memory OLTP Database Size 30GBUsers to generate load 12,000User Delay (ms) 0Repeat Delay (ms) 0Minutes of Ramp Time0 Improve Business Productivity and User Experience 8Test ResultsThis section shows the test results by each category of test: transactional workload performance and database start-up performance. The transactional workload performance results are shown by category: overall performance, memoryoptimized legroup performance, and transaction log performance.The charts reect testing with a scale of 12,000 users because the storage arrays capabilities peaked at that workload. Testing beyond a 12,000 user load resulted in timeouts with In-Memory OLTP, which stopped data processing for extended periods of time.40GB In-Memory OLTP Transactional Workload Test ResultsOVERALL PERFORMANCEThe chart below shows a summarized view of the transactional performance testing results. Across all performance indicators, Fusion ioMemory technology increases business productivity by providing more transactional throughput with signicantly lower latency.Figure 2. Fusion ioMemory products increase In-Memory OLTP performance more efectively than an enterprise disk Improve Business Productivity and User Experience 9MEMORY-OPTIMIZED FILEGROUP PERFORMANCEOne set of tests compared write bandwidth and latency of Fusion ioMemory products to an enterprise disk array to see how each handled the impact of background processes, such as continuous checkpoint. As the charts show, the Fusion ioMemory system delivers consistent high performance, which helps ensure durability.Figure 3. Fusion ioMemory products enable 84% faster in-memory checkpoint processes with much less variation.Figure 4. Continuous checkpoints are faster due to 75% higher average bandwidth. Improve Business Productivity and User Experience 10TRANSACTION LOG PERFORMANCEThe in-memory database results in much greater workload on transaction logs. Slow I/O on the transaction log reduces database performance. Tests measured the average and maximum transactions per second that the two systems completed over a 45-minute period. Tests also measured latency to compare transactional processing speeds to show the responsiveness of the database under load, and the speed it can serve individual requests. Fusion ioMemory products completed 4.5x more transactions over the test period, and did so with much higher response times, thus making each database server more scalable.Figure 5. Fusion ioMemory system enables 4.4X more user transactions per second.Figure 6. 76% faster continuous checkpoint performance increases transactional processing speeds and business productivity. Improve Business Productivity and User Experience 11Figure 7. 91% lower latency delivers consistently fast response times, which improves the user experience and helps IT condently meet SLAs.Figure 8. 4X faster transaction log writes eliminates I/O slowdowns. Improve Business Productivity and User Experience 12Database Startup TestsDATABASE STARTUP PERFORMANCEThe database startup test measured how long it took to load 120GB of data into DRAM. As the chart below shows, thedata loaded in 72 seconds from the ioDrive2 Duo, as opposed to 222 seconds from the disk arrayor 308% faster. Thisperformance increases system resilience and facilitates maintenance, enabling organizations to deliver on internalService Level Agreements (SLAs).Figure 9. Database startup on Fusion ioMemory is 308% faster than from an enterprise disk array. Improve Business Productivity and User Experience 13Scaling Beyond 12,000 UsersIn addition to testing transaction processing scalability, its useful to know the user load each server can support. Accordingly, testing was extended beyond 12,000 users. As stated above, our storage array testing peaked at 12,000 users due to severe write latency. With the Fusion ioMemory solution, our scalability test peaked at 24,000 users before processor utilization reached 80%.Figure 10. With 24,000 users write latency consistently stays under 220 microseconds. Improve Business Productivity and User Experience 14Figure 11. Database transactions average 109,000 per second once all 24,000 users are on the system.SummaryFusion ioMemory products extend the power of SQL Server 2014 In-Memory OLTP databases by removing I/O bottlenecks associated with transaction logs and checkpoints that become more severe under the workload of an inmemory database. They also increase startup, reboot, and failover speeds to increase resiliency. Finally, they also increase the user load each server can support. The table below summarizes the benets. Business Value Key PerformanceIndicators Enterprise-Class Disk Array with 2014 SQL ServerIn-Memory OLTPioDrive2 Duo 2.4TB with SQL Server 2014 In-Memory OLTP Business ProcessImprovementImprove CustomerExperience User Transaction Wait Time () 1329 117Reduced user wait timesby 91%Serve More Customers Transaction Throughput (MB/s) 42 172Increased throughputby 409%Improve BusinessProductivityTotal Transactions Processed(over 45 minutes)6,362,883 28,328,639Processed 445%more transactionsDeliver on Internal Service Level AgreementsDatabase Startup Time (sec) 222 72Reduced startup timeby 67% Improve Business Productivity and User Experience 15Appendix AAppendix A: Is SQL Server In-Memory OLTP Right for You?On the surface, workloads that are characterized by a high amount of latching or locking would be classied as good candidates for the SQL Server 2014 In-Memory OLTP feature. While that may be true, Microsoft SQL Server 2014 provides several advisor tools and usage reports to help identify which tables and stored procedures are the best candidates for storing in memory. It is highly recommended that you a) congure the Management Data Warehouse to collect usage analysis on tables and stored procedures; and b) run the advisory tool to determine which tables and stored procedures would benet from In-Memory OLTP. As mentioned previously, a full database migration isnt required. Database administrators have the exibility to move individual tables and stored procedures into SQL Server In-Memory OLTP. More information on In-Memory OLTP migration can be found here:http://msdn.microsoft.com/en-us/library/dn247639(v=sql.120).aspxBelow is the step-by-step procedure to analyze and migrate data:1.Congure the Management Data Warehouse (Data Collection > Tasks > Congure Management Data Warehouse). Improve Business Productivity and User Experience 16Appendix A2.Click Next to progress through the wizard. Improve Business Productivity and User Experience 17Appendix A3.Create your Management Data Warehouse (MDW) database. Improve Business Productivity and User Experience 18Appendix A4.Select the appropriate server and newly created MDW database. Improve Business Productivity and User Experience 19Appendix A5.Add necessary logins and users. Improve Business Productivity and User Experience 20Appendix A6.Verify actions and click Finish. Improve Business Productivity and User Experience 21Appendix A7.Click Close. Improve Business Productivity and User Experience 22Appendix A8.Select the appropriate server and database. Check the box for Transaction Performance Collection Analysis. Improve Business Productivity and User Experience 23Appendix A9.Click Finish. Improve Business Productivity and User Experience 24Appendix A10. In Object Explorer navigate to Data Collection, right click Stored Procedure Usage Analysis and select Start. Then right click Table Usage Analysis and select Start. Improve Business Productivity and User Experience 25Appendix A11.Right click the MDW database. Select Reports > Management Data Warehouse > Transaction Performance Analysis Overview. The AMR tool for In-Memory OLTP opens.Table Usage AnalysisIn the AMR tool for In-Memory OLTP you can view analysis on tables, stored procedure usage, and table contention. Improve Business Productivity and User Experience 26Appendix AThe Table Usage chart illustrates which tables would benet from SQL Server In-Memory OLTP, based on usage. The chart also illustrates the degree of migration difculty. Improve Business Productivity and User Experience 27Appendix ATABLE CONTENTION ANALYSISThe Table Contention chart illustrates which tables would benet from In-Memory OLTP, based on table contention. The chart also illustrates the degree of migration difculty. Improve Business Productivity and User Experience 28Appendix ASTORED PROCEDURE USAGE ANALYSISThe Stored Procedure report uses a bar chart to identify which procedures will be benet from In-Memory OLTP based on usage, with CPU time measured in milliseconds. Improve Business Productivity and User Experience 29Appendix AMEMORY OPTIMIZATION ADVISORBefore starting a table migration to In-Memory OLTP, we recommend reading the migration information on Microsoft TechNet at http://technet.microsoft.com/en-us/library/dn247639(v=sql.120).aspx.Below is a step-by-step procedure for migrating tables:1.This advisor is based on the recommendations from the AMR reports. Right click the table to migrate and select Memory Optimizer Advisor. Improve Business Productivity and User Experience 30Appendix A2.Follow the screens in the wizard. Improve Business Productivity and User Experience 31Appendix A3.If necessary, x the items that failed during the Memory Optimization Checklist step. Click Next. Improve Business Productivity and User Experience 32Appendix A4.Fix all warnings to ensure a smooth migration. Improve Business Productivity and User Experience 33Appendix A5.Name the memory-optimized le group, change the logical le name if necessary, and change the table name. Improve Business Productivity and User Experience 34Appendix A6.Select the appropriate primary key column(s) and hash bucket size for the non-clustered index. Click Next. Improve Business Productivity and User Experience 35Appendix A7.Complete the migration. Improve Business Productivity and User Experience 36Appendix ANative Compilation AdvisorBelow is a step-by-step procedure for using the Native Compilation Advisor:1.Click Next. Improve Business Productivity and User Experience 37Appendix A2.Fix the code in the stored procedure associated with the warnings listed in the dialog. Improve Business Productivity and User Experience 38Appendix A3.Develop workarounds for unsupported TSQL elements.FOR MORE INFORMATIONContact a SanDisk representative, 1-800-578-6007 or [email protected] performance results discussed herein are based on testing and use of the above discussed products.Results and performance may vary according to congurations and systems, including drive capacity, system architecture and applications. 2014 SanDisk Corporation. All rights reserved. SanDisk is a trademark of SanDisk Corporation, registered in the United States and other countries. Fusion ioMemory, ioDrive, and others are trademarks of SanDisk Enterprise IP LLC. Other brand names mentioned herein are for identication purposes only and may be the trademarks of their respective holder(s).