Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQL Saturday #512 Boas Vindas Freddie Santos Senior Support Engineer - Microsoft.

Similar presentations


Presentation on theme: "SQL Saturday #512 Boas Vindas Freddie Santos Senior Support Engineer - Microsoft."— Presentation transcript:

1 SQL Saturday #512 Boas Vindas Freddie Santos Senior Support Engineer - Microsoft

2 Speaker Bio Frederico Guimarães Não tenho, o que é isso? https://www.linkedin.com/in/fredguis fredguis@live.com Não tenho, mas é uma boa ideia; Frederico Santos ou Freddie, atua como Senior Support Engineer na Microsoft. Trabalha a mais de 15 anos com Tecnologia da Informação, dos quais a quase 9 dedicados a sistemas de banco de dados em especial SQL Server, desde versões 7.0 até 2016. Atualmente provê suporte ao Microsoft Analytics Platform System (PDW) para empresas Forbes 500 clients da Microsoft. Além disso adora passar seu tempo livre jogando video game, ou brincando com seus dois filhos Nathanael e Estevão.

3 Patrocinadores

4 Links  http://facebook.com/devSQL  devsql-subscribe@yahoogrupos.com.br  SQL Server Discovery Day  http://www.eventbrite.com/e/sql-discovery-day- tickets-25185568714  Utilize nossa hashtag no twitter: #SqlSatRJ

5  The release of SQL Server 2016 focus on some new features: Query Store, Temporal Tables, Live Query Debug, etc)  But additionally we introduced some improvements in existing features, and database engine.

6  Prior to SQL Server 2016, most workloads require some tuning effort:  Activate Instant File Initialization  Adjust TempDB configuration  Turn on trace flags  Change configuration parameters Recommended updates and configuration options for SQL Server 2012 and SQL Server 2014 with high-performance workloads (2964518)

7  Trace flag 4199 hotfixes made to previous releases will be enabled under compatibility level 130  Trace flag 4199 will be used to release any future hotfixes for databases under compatibility level 130 SQL Server query optimizer hotfix trace flag 4199 servicing model (974006)

8

9  Scales the creation and expansion of data files  Requires ‘Manage Volume Privilege’ option, which is off by default

10 SQL Data File 0000

11 SQL Data File

12  SQL Server 2016 setup provides the option to enable ‘Perform Volume Maintenance Task’

13  Lots of papers, KBs and blogs outline the need to reconfigure tempdb for scalability  Dedicated drive  Multiple data files, same size and auto-growth settings  Trace flag 1117 (all data files grow at the same time)  Trace flag 1118 (no mixed extents)

14  SQL Server 2016 setup provides a new tab for tempdb configuration  Multiple files and directories  Same auto-growth settings  TFs 1117 and 1118 on by default

15  Trace flag 1118 on by default, replaced by a new ALTER DATABASE setting  ALTER DATABASE AdventureWorks SET MIXED_PAGE_ALLOCATION ON  Trace flag 1117 off by default, can be set at the FILEGROUP level  ALTER DATABASE MODIFY FILEGROUP { AUTOGROW_ALL_FILES | AUTOGROW_SINGLE_FILE }

16  Initial size is now 8 MB, auto-growth for data and log files is now 64 MB (same for tempdb)  Optional configuration values that affect the code at the database level (Database Scoped Configurations)  ALTER DATABASE SCOPED CONFIGURATION

17  Clear the procedure cache  Configure MAXDOP  Set the cardinality estimation model  Enable or disable parameter sniffing  Enable or disable query optimization hotfixes  It was released on Azure Database (SQL Azure – First)

18 ALTER DATABASE SCOPED CONFIGURATION { { [ FOR SECONDARY] SET } } | CLEAR PROCEDURE_CACHE [;] ::= { MAXDOP = { | PRIMARY} | LEGACY_CARDINALITY_ESTIMATION = { ON | OFF | PRIMARY} | PARAMETER_SNIFFING = { ON | OFF | PRIMARY} | QUERY_OPTIMIZER_HOTFIXES = { ON | OFF | PRIMARY} }

19  Since SQL Server 7.0, log blocks are sector aligned and stamped with all zeroes (0x00)  Many HW implementations detect patterns of 0x00’s and reclaim these blocks  Hardware reclamation can force new transaction log records to repeat acquisition of space  SQL Server 2016 changes the stamp to 0xC0

20 SQL Data File 0000 Additional IO!!!

21  CMEMTHREAD waits can be a point of contention as machine sizes advances  TF 8048 only forces CPU partitioning, each time a contended CMEMTHREAD is found, a hotfix is required to partition it  In SQL Server 2016, contended CMEMTHREAD objects are automatically partitioned per node, and then by CPU

22

23

24

25  A large and a short CPU quantum worker can receive unbalanced access to scheduling resources  Previous SQL Server versions rely only on load factor and NUMA nodes  SQL Server 2016 monitors the quantum usage patterns allowing workers to get fair treatment

26 CPU0 CPU1 CPU2 CPU3 Thread: Scheduler:

27

28

29  During SQL Server 2000 / 2005 development, 8 CPUs per NUMA node was a high-end system  At startup, SQL Server 2016 configures Soft-NUMA on systems with 8 or more CPUs per NUMA node  Benefits: More IOCP Threads, Lazy Writer Threads.

30

31

32 Soft NUMA

33  Auto-update Stats  In-Memory Optimized Database Worker Pool  Use up to 4 sockets  Scaling storage (multiple offline checkpoint threads)  Parallelism

34 Log Offline Checkpoint Thread ~ 1GB 100-200 201-300 301-400 Memory-optimized data Filegroup

35 Log Offline Checkpoint Thread ~ 1GB 100-200 201-300 301-400 Memory-optimized data Filegroup Offline Checkpoint Thread One Thread per container SQL Server 2016

36  Low CPU consumption, and much better performance  Very high transaction rates with fast hardware (i.e. PCI-E Flash storage)  Fast performance on Redo Thread.  The bar we’re using is not % better than SQL2014. The bar is how close we are to the perf of a standalone server.

37

38 SQL Server 2014 (X64 installations) increase the number of contiguous, 8K pages from 16 to 32 (256K) for write operations. Storage subsystems on “old” systems are good once disk blocks has 64k to 128k.

39 SQL Server 2016 (X64 installations) increase the number of contiguous, 8K pages from 32 to 128 (1MB) for following operations: Lazy Writer Checkpoint Create Index Bulk Insert These write operations encompass 95%+ of the write operations for data file

40 Default will pace by I/O responsiveness based on heuristics for spinning media (DAS) response times SQL Server 2008 16 dirty pages, whenever possible, by page id and flushed them in a single write. SQL Server 2012/14 gather 32 dirty pages, whenever possible. For SQL 2016 that value has been increased to 128 pages. Checkpoint – SQL 7 to 2014

41 Indirect checkpoint is the recommended configuration, especially on systems with large memory footprints and default for databases created in SQL Server 2016. Checkpoint – SQL 2016

42

43  In SQL Server 2016, DBCC CHECK* uses a new page scanning coordinator design (CheckScanner)  This new design scales and performs better than the old design (MultiObjectScanner), shrinking maintenance windows  MAXDOP option has been added to CHECKTABLE, CHECKDB, and CHECKFILEGROUP

44

45  Starting with SQL Server 2016, only physical checks will be run against the following objects:  Filtered indexes  Persisted computed columns  UDT columns  Extended checks only with the EXTENDED_LOGICAL_CHECKS option  This change greatly reduces the duration of CHECKDB when these objects are present

46  Stay tuned! SQL 2016 – It Just Runs Faster Announcement

47 Questions

48 Patrocinadores

49 Thank you! Gracias! Obrigado!

50 Links  http://facebook.com/devSQL  devsql-subscribe@yahoogrupos.com.br  SQL Server Discovery Day  http://www.eventbrite.com/e/sql-discovery-day- tickets-25185568714  (personalize com seus links)  Utilize nossa hashtag no twitter: #SqlSatRJ


Download ppt "SQL Saturday #512 Boas Vindas Freddie Santos Senior Support Engineer - Microsoft."

Similar presentations


Ads by Google