Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server today.

Slides:



Advertisements
Similar presentations
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Advertisements

new database engine component fully integrated into SQL Server 2014 optimized for OLTP workloads accessing memory resident data achive improvements.
Big Data Working with Terabytes in SQL Server Andrew Novick
6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.
Project “Hekaton” adds in-memory technology to boost performance of OLTP workloads in SQL Server.
Meanwhile RAM cost continues to drop Moore’s Law on total CPU processing power holds but in parallel processing… CPU clock rate stalled… Because.
Objectives Provide insight into how SQL Server is used in Mission Critical Environments Provide real-world customer engagements and design to meet.
Microsoft SQL Server Administration for SAP SQL Server Architecture.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1 Preview of Oracle Database 12 c In-Memory Option Thomas Kyte
Client/Server Databases and the Oracle 10g Relational Database
Introduction to Databases Chapter 8: Improving Data Access.
Introduction. 
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
Architecture Rajesh. Components of Database Engine.
Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
Agenda for Today Do Chapter 14 Final Project Review for Final.
SQL Server 2014: Overview Phil ssistalk.com.
Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server.
1 CS 430 Database Theory Winter 2005 Lecture 16: Inside a DBMS.
SQL Server 2014 adds in-memory technology to boost performance of OLTP workloads.
IN-MEMORY OLTP By Manohar Punna SQL Server Geeks – Regional Mentor, Hyderabad Blogger, Speaker.
By Shanna Epstein IS 257 September 16, Cnet.com Provides information, tools, and advice to help customers decide what to buy and how to get the.
Transactions and Locks A Quick Reference and Summary BIT 275.
Srik Raghavan Principal Lead Program Manager Kevin Cox Principal Program Manager SESSION CODE: DAT206.
Meet Kevin Liu Principal Lead Program Manager Kevin Liu has been with Microsoft and the SQL Server engine team for 7 years, working on key projects like.
Ἑ κατόν by Niko Neugebauer. Niko Neugebauer PASS EvangelistPASS Evangelist SQL Server MVPSQL Server MVP SQLPort ( founder & leaderSQLPort.
Moore’s Law means more transistors and therefore cores, but… CPU clock rate stalled… Meanwhile RAM cost continues to drop.
1 Chapter 13 Parallel SQL. 2 Understanding Parallel SQL Enables a SQL statement to be: – Split into multiple threads – Each thread processed simultaneously.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.
Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server today.
1 Advanced Database Concepts Transaction Management and Concurrency Control.
Distributed Logging Facility Castor External Operation Workshop, CERN, November 14th 2006 Dennis Waldron CERN / IT.
Module 11: Managing Transactions and Locks
10 1 Chapter 10 - A Transaction Management Database Systems: Design, Implementation, and Management, Rob and Coronel.
TOP 10 Thinks you shouldn’t do with/in your database
DMBS Architecture May 15 th, Generic Architecture Query compiler/optimizer Execution engine Index/record mgr. Buffer manager Storage manager storage.
In-Memory OLTP The faster is now simpler in SQL Server 2016.
Vedran Kesegić. About me  M.Sc., FER, Zagreb  HRPro d.o.o. Before: Vipnet, FER  13+ years with SQL Server (since SQL 2000)  Microsoft Certified.
SQL Server 2014: In-Memory OLTP Adoption Considerations Mike
Cofax Scalability Document Version Scaling Cofax in General The scalability of Cofax is directly related to the system software, hardware and network.
Mladen Prajdić SQL Server MVP Hekaton The New SQL Server In-Memory OLTP Engine.
Best Practices for Columnstore Indexes Warner Chaves SQL MCM / MVP SQLTurbo.com Pythian.com.
Session Name Pelin ATICI SQL Premier Field Engineer.
Use Cases for In-Memory OLTP Warner Chaves SQL MCM / MVP SQLTurbo.com Pythian.com.
Memory-Optimized Tables Querying at the speed of light.
With Temporal Tables and More
In-Memory Capabilities
Architectures and Case Studies with In-Memory OLTP in SQL
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
UFC #1433 In-Memory tables 2014 vs 2016
7/17/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
Taking your application to memory
මොඩියුල විශ්ලේෂණය Buffer Pool Extension භාවිතය.
Super Scaling The LMAX Queue Pattern.
Working with Very Large Tables Like a Pro in SQL Server 2014
The Vocabulary of Performance Tuning
Real world In-Memory OLTP
SQL 2014 In-Memory OLTP What, Why, and How
The PROCESS of Queries John Deardurff
Statistics for beginners – In-Memory OLTP
In-Memory OLTP for Database Developers
The PROCESS of Queries John Deardurff
The Vocabulary of Performance Tuning
In Memory OLTP Not Just for OLTP.
The Vocabulary of Performance Tuning
Presentation transcript:

Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server today Key/Value pair where desire relational characteristics Scenarios where previously might not have implemented database in the critical path Common Scenarios o Session State Management o High Data Input Rate – “Shock Absorber” o ETL Target/Read-Scale o Latency critical OLTP

Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server today Key/Value pair where desire relational characteristics Scenarios where previously might not have implemented database in the critical path Customer Implementations o BWin.party o SQL Common Labs o Edgenet o SBILM

Largest regulated online entertainment provider worldwide Sports betting, Poker, Casino, Skillgames, Bingo, … > active users daily Up to different sports bets offered per day Approx. 1 mio new users every year Yearly revenue ~ 650 Million Euro

Massively scaled out Frontend State coordination on a single database (per farm) Every web page impression generates two batches at the database Very high peak loads Session size > 8 KB

High volume BLOB like data Short lived records High update rate Data itself is transient Little harm if data is lost Availability and consistency are key…

Need to keep 100% compatibility to the clients BLOB handling required 99% of requests use point lookup based on primary key Deferred durability vs. No durability

With stored procedures 100% compatibility is possible in almost all scenarios. With ad hoc queries almost everything works too through Interop. Limitations with constraints, triggers, etc Metadata based operations (e.g. Truncate) Error handling (Write/Write conflicts)

No native support in the Hekaton engine Workaround via data splitting Caution with consistency Zombie problems

Different locking behavior BUCKET_COUNT in hash indexes TRUNCATE is not supported No ALTER of either procedures or tables Hardware scaling (NUMA) Watch for memory consumption Buffer pool starvation Be aware of missing features (e.g. constraints)

Perf Counters Exceptions Stack Traces

Memory Optimized TablesSize in-Memory: ~3 GB, 3 tables out of 28 user tables Rows in largest tables: 17.3 million (Event) ~300k for EventDetail (40MB) Durability: SCHEMA_AND_DATA Indexing: HASH and nonclustered ordered Update-stats: Daily Native Compiled ProceduresConversions Required: Converted inserts to native procs Only do inserts and deletes (no updates) InterOp Wrappers for insert (due to Foreign Key limit) Read queries are all InterOp HardwareR820: 512GB memory allocated, 24-core (4x6) logical CPU’s, SAN storage Integration with other featuresSQL Server AlwaysOn AG’s (sync) and using Readable Secondary with In- Memory OLTP. SQL Server Managed Backup to Windows Azure Development time1.5 weeks although TAP Builds with new functionality extended the time

CREATE PROCEDURE datetime WITH NATIVE_COMPILATION, SCHEMABINDING, EXECUTE AS OWNER AS BEGIN ATOMIC WITH ( TRANSACTION ISOLATION LEVEL = SERIALIZABLE, LANGUAGE = 'english' ) SELECT [createdate],[updatedate],[envhk].[id],[eventid],[namevalueid],[name],[value] FROM [evs].[environment_HK] envhk WHERE [createdate] DELETE FROM [evs].[environment_HK] WHERE [createdate] END GO

CREATE PROCEDURE int = 1 AS BEGIN SET TRANSACTION ISOLATION LEVEL READ COMMITTED INT = 1 datetime = DATEADD(HH,-1 GETDATE()) WHILE > 0) BEGIN BEGIN TRAN INSERT INTO [evs].[environment]([createdate],[updatedate],[id],[eventid],[namevalueid],[name],[value]) EXEC = IF > 0 AND = 0) COMMIT TRAN ELSE ROLLBACK TRAN END GO

No.ChallengeResolution/Mitigation 1Assessing workload for In-Memory OLTPUsing AMR toolset to analyze workload and confirm bottleneck was helpful 2Initial approach was to move entire contention heavy table into memory-optimized (1.5B Records / 175GB) Using “Shock Absorber” and moving data past 5 min to disk-based tables more beneficial for long running reporting and data retention 3Working with LOB dataLimited row size to 7000 per row in the application and schema 4Foreign Key Constraints – Detail records of based on primary table key Developed manual checks in native compiled stored procedure calls to check for data consistency 5Measuring application performance in database counters changed Measured at the application level. Used a combination of SQL Transactions/sec and XTP Transactions – Transactions created/sec

Suppliers Retailers Interactive Sites

Memory Optimized TablesSize in Memory: ~6 GB, 2 out of 10 tables Rows in largest tables: 115 million, another 450k Durability: SCHEMA_AND_DATA Indexing: All HASH indexes Native Compiled ProceduresConversions Required: Converted all transformation operations Selects from clients, including INNER JOIN Able to remove client-side cache and replace with native proc calls. InterOp: Did not convert Bulk INSERT syntax. HardwareHyper-V VM: 128GB memory, 16 logical CPU’s, SAN storage Integration with other featuresDelayed Durability configured at database level. No requirement for HA/DR Development timeUnder a week of development & initial testing time

Seconds Rows 10 Million rows processed Standard ETL – 2 Hours 40 Minutes Memory Optimized – 20 Minutes Edgenet Case Study

No.ChallengeResolution/Mitigation 1Developing a plan on what to migrateStarted with single table, then iterated as new bottleneck manifested. Ended up moving second table to In-Memory OLTP Engine to satisfy joins in native procedures. 2Evaluating performance and potential disk latency Having the ability to re-submit/reproduce the data load were able to implement Delayed Durability to alleviate dependency on disk IO from critical path. 3Tested with SEQUENCE object (had IDENTITY)Determined they had a natural key and that it was easier to handle this sequencing logic outside of database

Client Application Data Distribute Aggregation System End-User Trading systems (Existing) Transaction Compare In-Memory OLTP AlwaysOn AG SQL 2008 R2 SQL 2014 Display POSITION Cover Management system SQL 2014 There are 3 sets of existing trading systems = 30 trade services, expecting over 50 Trading system sends trading result to Cover management system Trading systems can be scaled out Cover management is not. <- Need In-Memory OLTP Trading Log table (insert); Aggregation table (update)

Memory Optimized TablesSize in-Memory: ~8 GB, 2 tables Rows in largest tables: ~100,000 rows in trading log Durability: SCHEMA_AND_DATA Indexing: HASH and nonclustered memory-optimized tables Native Compiled ProceduresConversions Required: This system was developed specifically for In-Memory OLTP Almost all operation in native compiled procedures HardwareHP DL560 G8 (4-Socket, 8-Core) 768GB memory Data files and log files located on Fusion IO drive (2.4TB x 2) Integration with other featuresSQL Server AlwaysOn AG’s (sync) Development timeRe-developed application along with SQL14 TAP

SBILM Case Study

No.ChallengeResolution/Mitigation 1Chatty applicationCombine [n] transactions into one batch for better performance 2Update conflict require re-try. There are heavy updates to a few rows Application modification to allow one thread to update a certain currency pair. This means 26 update thread for 26 currency pair 3Files on disk much larger than in memory table size, storage size and clean-up (merge and garbage collection) In many cases, in-particular for small in-memory footprint this can be the case. For more details please refer to (Storage Allocation and Management for memory-optimized tables blog) Also, modified behavior in RTMStorage Allocation and Management for memory-optimized tables 4Lack of parallelism with memory-optimized tables Consider how critical parallelism is in plan (vs. native proc). Tested but currently no need to implement 5Inability to alter In-Memory OLTP objects (during application upgrade) Process requires downtime: Stop workload, backup data from table, drop objects (Table, SP), create new objects, load data, set privilege, resume workload 6Significant performance degradation in 8-socket (glued) server Limiting cores used to one Socket (NUMA node) improves performance

No improvement Same latency Less volume 2-10X improvement

ostress.exe -S. –E -dAdventureWorks2012 -Q"EXEC –n