{"id":15,"date":"2018-10-05T10:42:00","date_gmt":"2018-10-05T10:42:00","guid":{"rendered":""},"modified":"2018-12-10T14:10:47","modified_gmt":"2018-12-10T14:10:47","slug":"hammerdb-best-practice-for-sql-server-performance-and-scalability","status":"publish","type":"post","link":"https:\/\/www.hammerdb.com\/blog\/uncategorized\/hammerdb-best-practice-for-sql-server-performance-and-scalability\/","title":{"rendered":"HammerDB Best Practice for SQL Server Performance and Scalability"},"content":{"rendered":"<div style=\"margin-bottom: 14.15pt;\"><span style=\"background-color: white; color: #666666; font-family: 'verdana' , sans-serif; font-size: 14.6667px;\">With the move to HammerDB v3.0 as well as refactoring a lot of code the documentation moved to Docbook format. As with the Oracle best practice dcoument previously at v2 there was an SQL Server best practice document that is no longer included in the current documentation. As a number of people have asked for it it is published here.\u00a0<\/span><\/div>\n<div style=\"margin-bottom: 14.15pt;\"><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">CPU, Memory and I\/O<\/span><\/div>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">The key dependence of performance is hardware related with the CPU being the most important factor on the levels of performance available from the rest of the system. At the next level from the CPU is memory with the best levels of performance available from having sufficient memory to cache all of the test database. Finally I\/O performance is crucial with modern systems and CPUs available to drive high levels of throughput, In particular for OLTP workloads write performance to transaction logs is critical and often a major resource constraint.\u00a0 Solid State Disks (SSDs) are strongly recommended for both data areas and transaction logs to provide the I\/O capabilities to match the CPU performance of up to date systems. <\/span><\/span><\/div>\n<h6 style=\"mso-list: none; tab-stops: 36.0pt; text-indent: 0cm;\"><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">BIOS Settings<\/span><\/h6>\n<div>\u00a0<span style=\"font-family: 'verdana' , sans-serif; font-size: 11pt;\">Systems are shipped with default BIOS and are not necessarily optimized for database performance.<\/span><span style=\"font-family: 'verdana' , sans-serif; font-size: 11pt;\">\u00a0 <\/span><span style=\"font-family: 'verdana' , sans-serif; font-size: 11pt;\">BIOS settings should be checked and settings verified with the vendor to ensure that they are advantageous to SQL Server Performance. A common error is to accept a default setting of \u201cHigh Performance\u201d that sets a subset of lower level BIOS settings without verifying what these are.<\/span><span style=\"font-family: 'verdana' , sans-serif; font-size: 11pt;\">\u00a0 <\/span><span style=\"font-family: 'verdana' , sans-serif; font-size: 11pt;\">A default setting of \u201cHigh Performance\u201d will often result in lower performance for a database environment.<\/span><\/div>\n<h6 style=\"mso-list: l0 level3 lfo1;\"><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">Power Options<\/span><\/h6>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Open the power options dialog and choose High Performance if not already selected.<\/span><\/span><\/div>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp1-300x169.png\" width=\"400\" height=\"225\" border=\"0\" data-original-height=\"675\" data-original-width=\"1200\" \/><\/a><\/div>\n<h6 style=\"mso-list: l0 level3 lfo1;\"><span style=\"font-family: 'calibri' , sans-serif; mso-fareast-font-family: Calibri;\"><span style=\"mso-list: Ignore;\"><span style=\"font: 7.0pt 'Times New Roman';\">\u00a0<\/span><\/span><\/span><!--[endif]--><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">Verify Single Threaded Performance<\/span><\/h6>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Verify that you achieve maximum CPU single threaded performance by creating and running the following stored procedure. <\/span><\/span><\/div>\n<div style=\"margin-left: 18.0pt;\"><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">USE<\/span><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: teal;\">[tpcc]<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">GO<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">SET<\/span><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: blue;\">ANSI_NULLS<\/span> <span style=\"color: blue;\">ON<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">GO<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">CREATE<\/span><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: blue;\">PROCEDURE<\/span> <span style=\"color: teal;\">[dbo]<\/span><span style=\"color: grey;\">.<\/span><span style=\"color: teal;\">[CPUSIMPLE]<\/span><span style=\"mso-spacerun: yes;\">\u00a0 <\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">AS<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0 <\/span><span style=\"color: blue;\">BEGIN<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">DECLARE<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: teal;\">@n<\/span> <span style=\"color: blue;\">numeric<\/span><span style=\"color: grey;\">(<\/span>16<span style=\"color: grey;\">,<\/span>6<span style=\"color: grey;\">)<\/span> <span style=\"color: grey;\">=<\/span> 0<span style=\"color: grey;\">,<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: teal;\">@a<\/span> <span style=\"color: blue;\">DATETIME<\/span><span style=\"color: grey;\">,<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: teal;\">@b<\/span> <span style=\"color: blue;\">DATETIME<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">DECLARE<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: teal;\">@f<\/span> <span style=\"color: blue;\">int<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">SET<\/span> <span style=\"color: teal;\">@f<\/span> <span style=\"color: grey;\">=<\/span> 1<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">SET<\/span> <span style=\"color: teal;\">@a<\/span> <span style=\"color: grey;\">=<\/span> <span style=\"color: magenta;\">CURRENT_TIMESTAMP<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">WHILE<\/span> <span style=\"color: teal;\">@f<\/span> <span style=\"color: grey;\">&lt;=<\/span> 10000000<span style=\"mso-spacerun: yes;\">\u00a0 <\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">BEGIN<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">SET<\/span> <span style=\"color: teal;\">@n<\/span> <span style=\"color: grey;\">=<\/span> <span style=\"color: teal;\">@n<\/span> <span style=\"color: grey;\">%<\/span> 999999 <span style=\"color: grey;\">+<\/span> <span style=\"color: magenta;\">sqrt<\/span><span style=\"color: grey;\">(<\/span><span style=\"color: teal;\">@f<\/span><span style=\"color: grey;\">)<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">SET<\/span> <span style=\"color: teal;\">@f<\/span> <span style=\"color: grey;\">=<\/span> <span style=\"color: teal;\">@f<\/span> <span style=\"color: grey;\">+<\/span> 1<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">END<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">SET<\/span> <span style=\"color: teal;\">@b<\/span> <span style=\"color: grey;\">=<\/span> <span style=\"color: magenta;\">CURRENT_TIMESTAMP<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">PRINT<\/span> <span style=\"color: red;\">&#8216;Timing = &#8216;<\/span> <span style=\"color: grey;\">+<\/span> <span style=\"color: magenta;\">ISNULL<\/span><span style=\"color: grey;\">(<\/span><span style=\"color: magenta;\">CAST<\/span><span style=\"color: grey;\">(<\/span><span style=\"color: magenta;\">DATEDIFF<\/span><span style=\"color: grey;\">(<\/span><span style=\"color: teal;\">MS<\/span><span style=\"color: grey;\">,<\/span> <span style=\"color: teal;\">@a<\/span><span style=\"color: grey;\">,<\/span> <span style=\"color: teal;\">@b<\/span><span style=\"color: grey;\">)<\/span><span style=\"color: blue;\">AS<\/span> <span style=\"color: blue;\">VARCHAR<\/span><span style=\"color: grey;\">),<\/span><span style=\"color: red;\">&#8221;<\/span><span style=\"color: grey;\">)<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: blue;\">PRINT<\/span> <span style=\"color: red;\">&#8216;Res = &#8216;<\/span><span style=\"color: grey;\">+<\/span> <span style=\"color: magenta;\">ISNULL<\/span><span style=\"color: grey;\">(<\/span><span style=\"color: magenta;\">CAST<\/span><span style=\"color: grey;\">(<\/span><span style=\"color: teal;\">@n<\/span> <span style=\"color: blue;\">AS<\/span> <span style=\"color: blue;\">VARCHAR<\/span><span style=\"color: grey;\">),<\/span><span style=\"color: red;\">&#8221;<\/span><span style=\"color: grey;\">)<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-spacerun: yes;\">\u00a0\u00a0 <\/span><span style=\"color: blue;\">END<\/span><\/span><\/div>\n<div style=\"margin-left: 18.0pt;\"><\/div>\n<div style=\"margin-left: 18.0pt;\"><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">In any database (ie use [ database name ] ) create the stored procedure by running the code above as shown.<\/span><\/span><\/div>\n<div style=\"margin-left: 18.0pt;\"><\/div>\n<div style=\"margin-left: 18.0pt;\"><a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp2-300x184.png\" width=\"400\" height=\"245\" border=\"0\" data-original-height=\"747\" data-original-width=\"1218\" \/><\/a><\/div>\n<div><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Right click on CPUSIMPLE and click execute stored procedure, Click OK and wait &#8211; if it runs OK then return value is 0\u00a0 click on message to see the time the procedure took to run:<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">For example:<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">Timing = 8250<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">Res = 873729.721235<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">(1 row(s) affected)<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><\/div>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">I<\/span><\/span><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">n this case the stored procedure took 8.2 seconds to run. Actual performance will depend on your installed CPU however an up to date CPU would be expected to complete this routine in under 10 seconds. For more information on this test and troubleshooting view the older blog entry <a href=\"https:\/\/itpeernetwork.intel.com\/how-to-maximise-cpu-performance-for-sql-server-on-windows\/\"><span style=\"color: blue;\">How to Maximise CPU Performance for SQL Server on Windows<\/span><\/a>.<\/span><\/span><\/div>\n<h6 style=\"mso-list: l0 level3 lfo1;\">Network Bandwidth<\/h6>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">With a highly scalable system network utilisation may exceed Gigabit capacity between log generation server and SUT.\u00a0 To increase capacity you may use either use 10GbE or configure NIC teaming for multiple Gigabit Ethernet adapters on both the server and both the LACP compatible switch in LACP mode.\u00a0 \u00a0Firstly the network switch must be configured to enable LACP using your switch documentation, then configure NIC teaming from the Server Management Window for the interfaces connected to the same switch as shown<\/span><\/span><\/div>\n<div><\/div>\n<div><a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp4-300x224.png\" width=\"400\" height=\"298\" border=\"0\" data-original-height=\"717\" data-original-width=\"960\" \/><\/a><\/div>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Confirm under Task Manager that Gigabit capacity has been exceeded whilst running a HammerDB workload. <\/span><\/span><\/div>\n<h6><a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp5-300x273.png\" width=\"400\" height=\"362\" border=\"0\" data-original-height=\"600\" data-original-width=\"660\" \/><\/a><span style=\"mso-bookmark: _Toc390761917;\"><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\"><a style=\"font-family: 'Times New Roman'; font-size: medium; margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp3-300x184.png\" width=\"400\" height=\"245\" border=\"0\" data-original-height=\"747\" data-original-width=\"1218\" \/><\/a><\/span><\/span><\/h6>\n<h6><span style=\"mso-bookmark: _Toc390761917;\"><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">SQL Server <\/span><\/span><span style=\"mso-bookmark: _Toc390761917;\"><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">Properties<\/span><\/span><\/h6>\n<h3 style=\"mso-list: l0 level3 lfo1;\"><a href=\"https:\/\/www.blogger.com\/null\" name=\"_Toc390761917\"><\/a><\/h3>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Configure SQL Server according to your available hardware, this can be done either with the graphical tools as shown or manually as follows, the following example shows a memory configuration of between 256GB and 512GB. <\/span><\/span><\/div>\n<div><span style=\"font-family: 'calibri' , sans-serif; font-size: 11.0pt;\">\u00a0<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">exec sp_configure &#8216;show advanced options&#8217;, &#8216;1&#8217;<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">reconfigure with override<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">exec sp_configure &#8216;min server memory&#8217;, <\/span><span lang=\"EN-US\" style=\"color: red; font-family: 'consolas'; font-size: 10.0pt;\">256000 <\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">exec sp_configure &#8216;max server memory&#8217;, <\/span><span lang=\"EN-US\" style=\"color: red; font-family: 'consolas'; font-size: 10.0pt;\">512000<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">exec sp_configure &#8216;recovery interval&#8217;,&#8217;32767&#8242;<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">exec sp_configure &#8216;max degree of parallelism&#8217;,&#8217;1&#8242;<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">exec sp_configure &#8216;lightweight pooling&#8217;,&#8217;1&#8242;<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">exec sp_configure &#8216;priority boost&#8217;, &#8216;1&#8217;<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">exec sp_configure &#8216;max worker threads&#8217;, 3000 <\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">exec sp_configure &#8216;default trace enabled&#8217;, 0 <\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">go <\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">reconfigure with override <\/span><\/div>\n<div><\/div>\n<div><a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp6-300x269.png\" width=\"400\" height=\"358\" border=\"0\" data-original-height=\"632\" data-original-width=\"704\" \/><\/a><\/div>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Also ensure that Processor Affinity is set automatically as shown.<\/span><\/span><\/div>\n<div>\u00a0<a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp7-300x269.png\" width=\"400\" height=\"358\" border=\"0\" data-original-height=\"632\" data-original-width=\"704\" \/><\/a><\/div>\n<h6><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">Database Creation<\/span><\/h6>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Building the HammerDB schema directly on the database server will be quicker as you will be able to take advantage of more cores and not be required to pass all of the data across the network. <\/span><\/span><\/div>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Firstly pre-create an empty database called tpcc (or any other name) as shown, this enables you to choose and configure your storage in advance. Ensure that the initial DATA files are sufficiently large (eg 200GB for 4 socket) to ensure that the files are not continually growing during a test at the expense of performance. You may also wish to configure the Autogrowth properties to ensure that if the file does grow it grows sufficiently to prevent additional performance impact. <\/span><\/span><\/div>\n<div><a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp8-300x300.png\" width=\"400\" height=\"397\" border=\"0\" data-original-height=\"506\" data-original-width=\"508\" \/><\/a><\/div>\n<h6><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">Schema Build and Configure<\/span><\/h6>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Once built backup the TPCC database, a simple way is to stop SQL Server and copy the TPCC DATA and LOG to a backup directory. To restore the schema delete the existing schema, copy the DATA and LOG directories from backup and use the attach command to reattach the original database, configure the schema using the following commands.<\/span><\/span><\/div>\n<div><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">ALTER DATABASE tpcc SET RECOVERY SIMPLE<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">GO<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">ALTER DATABASE tpcc SET TORN_PAGE_DETECTION OFF<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">GO<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">ALTER DATABASE tpcc SET PAGE_VERIFY NONE<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: #1f497d; font-family: 'consolas'; font-size: 10.0pt;\">GO<\/span><\/div>\n<h6 style=\"mso-list: l0 level3 lfo1;\"><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">Partition the History Table<\/span><\/h6>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">For highly scalable systems partitioning the history table can reduce insert contention either use the SQL Server Management Studio or run a statement as follows modifying the highlighted values according to the warehouse count for 1 partition per 100 warehouses. <\/span><\/span><\/div>\n<div><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">USE<\/span><span lang=\"EN\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: teal;\">[tpcc]<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">GO<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">BEGIN<\/span><span lang=\"EN\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: blue;\">TRANSACTION<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">CREATE<\/span><span lang=\"EN\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: blue;\">PARTITION<\/span> <span style=\"color: blue;\">FUNCTION<\/span><span style=\"color: teal;\">[HISTORY_PART]<\/span><span style=\"color: grey;\">(<\/span><span style=\"color: blue;\">int<\/span><span style=\"color: grey;\">)<\/span> <span style=\"color: blue;\">AS<\/span> <span style=\"color: blue;\">RANGE<\/span> <span style=\"color: grey;\">LEFT<\/span> <span style=\"color: blue;\">FOR<\/span> <span style=\"color: blue;\">VALUES <\/span><span style=\"background: yellow; color: grey;\">(<\/span><span style=\"background: yellow; mso-highlight: yellow;\">1<span style=\"color: grey;\">,<\/span> 100<span style=\"color: grey;\">,<\/span>200<span style=\"color: grey;\">,<\/span> 300<span style=\"color: grey;\">,<\/span> 400<span style=\"color: grey;\">,<\/span> 500<span style=\"color: grey;\">,<\/span> 600<span style=\"color: grey;\">,<\/span> 700<span style=\"color: grey;\">,<\/span> 800<span style=\"color: grey;\">,<\/span> 900<span style=\"color: grey;\">)<\/span><\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">CREATE<\/span><span lang=\"EN\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: blue;\">PARTITION<\/span> <span style=\"color: teal;\">SCHEME<\/span><span style=\"color: teal;\">[HISTORY_PART]<\/span> <span style=\"color: blue;\">AS<\/span><span style=\"color: blue;\">PARTITION<\/span> <span style=\"color: teal;\">[HISTORY_PART]<\/span><span style=\"color: blue;\">TO <\/span><span style=\"color: grey;\">(<\/span><span style=\"background: yellow; color: teal;\">[PRIMARY]<\/span><span style=\"background: yellow; color: grey;\">,<\/span><span style=\"background: yellow; color: teal;\">[PRIMARY]<\/span><span style=\"background: yellow; color: grey;\">,<\/span><span style=\"background: yellow; color: teal;\">[PRIMARY]<\/span><span style=\"background: yellow; color: grey;\">,<\/span><span style=\"background: yellow; color: teal;\">[PRIMARY]<\/span><span style=\"background: yellow; color: grey;\">,<\/span><span style=\"background: yellow; color: teal;\">[PRIMARY]<\/span><span style=\"background: yellow; color: grey;\">,<\/span><span style=\"background: yellow; color: teal;\">[PRIMARY]<\/span><span style=\"background: yellow; color: grey;\">,<\/span><span style=\"background: yellow; color: teal;\">[PRIMARY]<\/span><span style=\"background: yellow; color: grey;\">,<\/span><span style=\"background: yellow; color: teal;\">[PRIMARY]<\/span><span style=\"background: yellow; color: grey;\">,<\/span><span style=\"background: yellow; color: teal;\">[PRIMARY]<\/span><span style=\"background: yellow; color: grey;\">,<\/span><span style=\"background: yellow; color: teal;\">[PRIMARY]<\/span><span style=\"background: yellow; color: grey;\">,<\/span><span style=\"background: yellow; color: teal;\">[PRIMARY]<\/span><span style=\"background: yellow; color: grey;\">)<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">CREATE<\/span><span lang=\"EN\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: blue;\">CLUSTERED<\/span> <span style=\"color: blue;\">INDEX<\/span><span style=\"color: teal;\">[ClusteredIndex_on_HISTORY_PART_634589363881526517]<\/span><span style=\"color: blue;\">ON<\/span> <span style=\"color: teal;\">[dbo]<\/span><span style=\"color: grey;\">.<\/span><span style=\"color: teal;\">[history]<\/span> <\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: grey; font-family: 'consolas'; font-size: 10.0pt;\">(<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><span style=\"color: teal;\">[h_w_id]<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: grey; font-family: 'consolas'; font-size: 10.0pt;\">)<\/span><span lang=\"EN\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">WITH <\/span><span lang=\"EN\" style=\"color: grey; font-family: 'consolas'; font-size: 10.0pt;\">(<\/span><span lang=\"EN\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">SORT_IN_TEMPDB<\/span><span lang=\"EN\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: grey;\">=<\/span> <span style=\"color: blue;\">OFF<\/span><span style=\"color: grey;\">,<\/span> <span style=\"color: blue;\">IGNORE_DUP_KEY<\/span> <span style=\"color: grey;\">=<\/span> <span style=\"color: blue;\">OFF<\/span><span style=\"color: grey;\">,<\/span> <span style=\"color: blue;\">DROP_EXISTING<\/span> <span style=\"color: grey;\">=<\/span> <span style=\"color: blue;\">OFF<\/span><span style=\"color: grey;\">,<\/span> <span style=\"color: blue;\">ONLINE<\/span> <span style=\"color: grey;\">=<\/span> <span style=\"color: blue;\">OFF<\/span><span style=\"color: grey;\">)<\/span> <span style=\"color: blue;\">ON<\/span> <span style=\"color: teal;\">[HISTORY_PART]<\/span><span style=\"color: grey;\">(<\/span><span style=\"color: teal;\">[h_w_id]<\/span><span style=\"color: grey;\">)<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">COMMIT<\/span><span lang=\"EN\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: blue;\">TRANSACTION<\/span><\/span><\/div>\n<h6 style=\"mso-list: l0 level3 lfo1;\"><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">Resize the Transaction Log<\/span><\/h6>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span style=\"font-family: 'verdana' , sans-serif;\"><span lang=\"EN-US\">\u00a0<\/span><span style=\"font-size: 11pt;\">As the recovery interval has already been set to the maximum permitted a checkpoint will occur when the transaction log is 70% full, at high performance depending on the I\/O write performance to your data files, the checkpoint produce an I\/O effect noticeable in the HammerDB transaction counter as follows:<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp10-300x249.png\" width=\"400\" height=\"331\" border=\"0\" data-original-height=\"681\" data-original-width=\"822\" \/><\/a><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">To observe the checkpoint set DBCC trace 3502, 3504 and 3605 and open the error log.<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: #1f497d; font-family: 'calibri' , sans-serif; font-size: 10.0pt;\">2014-01-15 14:04:35.18 spid56<span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>DBCC TRACEON 3502, server process ID (SPID) 56. This is an informational message only; no user action is required.<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: #1f497d; font-family: 'calibri' , sans-serif; font-size: 10.0pt;\">2014-01-15 14:06:52.74 spid56<span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>DBCC TRACEON 3504, server process ID (SPID) 56. This is an informational message only; no user action is required.<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: #1f497d; font-family: 'calibri' , sans-serif; font-size: 10.0pt;\">2014-01-15 14:06:52.74 spid56<span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>DBCC TRACEON 3605, server process ID (SPID) 56. This is an informational message only; no user action is required.<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">The following example shows that the checkpoint took 14.7 seconds writing at 1GB\/sec that coincided with the drop in performance.<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: #1f497d; font-family: 'calibri' , sans-serif; font-size: 10.0pt;\">2014-01-16 11:41:11.75 spid20s<span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0 <\/span>FlushCache: cleaned up 1932082 bufs with 948934 writes in 14739 ms (avoided 25317 new dirty bufs) for db 5:0<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: #1f497d; font-family: 'calibri' , sans-serif; font-size: 10.0pt;\">2014-01-16 11:41:11.75 spid20s<span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>average throughput: 1024.11 MB\/sec, I\/O saturation: 418155, context switches 562834<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: #1f497d; font-family: 'calibri' , sans-serif; font-size: 10.0pt;\">2014-01-16 11:41:11.75 spid20s<span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>last target outstanding: 31729, avgWriteLatency 26<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"color: #1f497d; font-family: 'calibri' , sans-serif; font-size: 10.0pt;\">2014-01-16 11:41:11.75 spid20s<span style=\"mso-spacerun: yes;\">\u00a0\u00a0\u00a0\u00a0 <\/span>About to log Checkpoint end.<\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">To postpone the checkpoint until after the test, resize the logfile. Being too small will cause checkpoints before the test is complete \u2013 too large impact will performance \u2013 the following example resizes the logfile to 64GB. <\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">use<\/span><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: teal;\">tpcc<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">dbcc<\/span><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: teal;\">shrinkfile<\/span><span style=\"color: grey;\">(<\/span><span style=\"color: red;\">&#8216;tpcc_log&#8217;<\/span><span style=\"color: grey;\">,<\/span><span style=\"color: teal;\">truncateonly<\/span><span style=\"color: grey;\">)<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">alter<\/span><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: blue;\">database<\/span> <span style=\"color: teal;\">tpcc<\/span> <span style=\"color: blue;\">modify<\/span> <span style=\"color: blue;\">file <\/span><span style=\"color: grey;\">(<\/span><span style=\"color: teal;\">name<\/span><span style=\"color: grey;\">=<\/span><span style=\"color: red;\">&#8216;tpcc_log&#8217;<\/span><span style=\"color: grey;\">,<\/span> <span style=\"color: teal;\">size<\/span><span style=\"color: grey;\">=<\/span>64000<span style=\"color: grey;\">)<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN-US\" style=\"color: blue; font-family: 'consolas'; font-size: 10.0pt;\">dbcc<\/span><span lang=\"EN-US\" style=\"font-family: 'consolas'; font-size: 10.0pt;\"> <span style=\"color: teal;\">loginfo<\/span><span style=\"color: grey;\">(<\/span><span style=\"color: red;\">&#8216;tpcc&#8217;<\/span><span style=\"color: grey;\">)<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Select Checkpoint when complete to checkpoint after the timed test has completed.<\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"font-family: 'calibri' , sans-serif; mso-ansi-language: EN;\"><a style=\"font-family: 'Times New Roman'; margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp11-300x152.png\" width=\"400\" height=\"202\" border=\"0\" data-original-height=\"177\" data-original-width=\"349\" \/><\/a><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Observe performance for an entire test to ensure that the transaction counter is level showing that SQL Server performance is consistent without a drop in performance for checkpoints. <\/span><\/span><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><\/div>\n<div style=\"mso-layout-grid-align: none; text-autospace: none;\"><span lang=\"EN\" style=\"font-family: 'calibri' , sans-serif; mso-ansi-language: EN;\"><a style=\"font-family: 'Times New Roman'; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp12-300x249.png\" width=\"400\" height=\"331\" border=\"0\" data-original-height=\"681\" data-original-width=\"822\" \/><\/a><\/span><\/div>\n<h6 style=\"mso-list: l0 level3 lfo1;\"><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">Monitoring<\/span><\/h6>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Use the<a href=\"http:\/\/sourceforge.net\/projects\/mssqlserverscri\/\"> <span style=\"color: blue;\">Open Source Fusion-IO MS SQL Server scripts<\/span><\/a> to identify the resource constraints. In this example WRITELOG is the main constraint and therefore adding LOG write I\/O capacity is the best method to improve performance (as CPU is not saturated).<\/span><\/span><\/div>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">If the CPU is saturated on a single load generation client (and not the SUT Server) then multiple load test clients can be used using the \u201cMaster-Slave\u201d functionality to drive a load from 2 clients simultaneously.\u00a0 \u00a0If the CPU is not saturated on the Server without having identified other resource constraints such as I\/O or network then increase the Virtual User count on the load generation client. <\/span><\/span><\/div>\n<div><a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp13.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp13-300x171.png\" width=\"400\" height=\"227\" border=\"0\" data-original-height=\"914\" data-original-width=\"1600\" \/><\/a><\/div>\n<h6><span style=\"font-family: 'calibri' , sans-serif; mso-bidi-font-family: 'Albany AMT';\">Processor Group Affinity<\/span><\/h6>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Windows Server 2008 and prior releases supported up to 64 CPUs only. Windows Server 2008 R2, 2012 and 2012 R2 supports up to 256 processors however divides these processors up into processor groups of 64 processors with handling of processor groups improving with each release of Windows.\u00a0 For example with 120 logical processors Windows Server 2012 R2 presents these CPUs as 2 Processor Groups of 60 logical processors each. HammerDB Metrics\u00a0can be used to illustrate the usage of Processor Groups by SQL Server as shown.<\/span><\/span><\/div>\n<div><a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp14.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp14-300x152.png\" width=\"400\" height=\"202\" border=\"0\" data-original-height=\"343\" data-original-width=\"677\" \/><\/a><\/div>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Most applications (including the HammerDB client are restricted to operating within a single processor group). SQL Server is able to operate across multiple Processor Groups however may restrict client connections to a single Processor Group or subset of Processor Groups for an individual test.<\/span><\/span><\/div>\n<div><a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp15.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp15-300x226.png\" width=\"400\" height=\"300\" border=\"0\" data-original-height=\"541\" data-original-width=\"719\" \/><\/a><\/div>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">Once initially assigned sessions do not move between Processor Groups and therefore performance and CPU utilisation may be artificially limited.\u00a0 Using the FusionIO Monitoring Scripts previously referenced when this Processor Group limitation occurs the top wait event is shown as \u201cThreading and CPU\u201d.\u00a0 \u00a0When running a test the aim is to achieve an even distribution of CPU utilization across all processors to result in good performance. Processor Group allocation is affected by modifying the allocation time. \u00a0To achieve this balance, in the HammerDB virtual user options modify the User Delay parameter to 10ms, this means that the user will wait for 10ms after the previous user logged on. <\/span><\/span><\/div>\n<div><a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp16.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp16-300x254.png\" width=\"400\" height=\"338\" border=\"0\" data-original-height=\"266\" data-original-width=\"314\" \/><\/a><\/div>\n<div><span style=\"font-size: 11pt;\"><span style=\"font-family: 'verdana' , sans-serif;\">A shortened connection time typically ensures an even distribution of connections across the server. Use the HammerDB Metrics tool\u00a0 to monitor the system to ensure good utilisation of system resources<\/span><\/span><span style=\"font-family: 'calibri' , sans-serif; font-size: 11.0pt;\">.<\/span><\/div>\n<p><a style=\"margin-left: 1em; margin-right: 1em; text-align: center;\" href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp17.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/sqlbp17-300x226.png\" width=\"400\" height=\"301\" border=\"0\" data-original-height=\"541\" data-original-width=\"717\" \/><\/a><br \/>\n<script>\n  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n  })(window,document,'script','https:\/\/www.google-analytics.com\/analytics.js','ga');\n  ga('create', 'UA-87720879-1', 'auto');\n  ga('send', 'pageview');\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the move to HammerDB v3.0 as well as refactoring a lot of code the documentation moved to Docbook format. As with the Oracle best practice dcoument previously at v2 there was an SQL Server best practice document that is no longer included in the current documentation. As a number of people have asked for &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.hammerdb.com\/blog\/uncategorized\/hammerdb-best-practice-for-sql-server-performance-and-scalability\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;HammerDB Best Practice for SQL Server Performance and Scalability&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"footnotes":""},"categories":[1],"tags":[],"ppma_author":[5],"class_list":["post-15","post","type-post","status-publish","format-image","hentry","category-uncategorized","post_format-post-format-image"],"authors":[{"term_id":5,"user_id":2,"is_guest":0,"slug":"hammerdb","display_name":"HammerDB","avatar_url":{"url":"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/logo-white.png","url2x":"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/logo-white.png"},"author_category":"","user_url":"http:\/\/www.hammerdb.com","last_name":"","first_name":"","job_title":"","description":""}],"_links":{"self":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":9,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":294,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts\/15\/revisions\/294"}],"wp:attachment":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/tags?post=15"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}