{"id":4615,"date":"2016-08-15T16:53:51","date_gmt":"2016-08-15T15:53:51","guid":{"rendered":"http:\/\/www.onomi.co.uk\/?p=4615"},"modified":"2018-08-21T11:16:36","modified_gmt":"2018-08-21T10:16:36","slug":"lightning-bolt-performance-sql-server","status":"publish","type":"post","link":"http:\/\/content.n4stack.io\/2016\/08\/15\/lightning-bolt-performance-sql-server\/","title":{"rendered":"Lightning Bolt performance from your SQL Server"},"content":{"rendered":"
[et_pb_section bb_built=”1″ admin_label=”section” _builder_version=”3.0.47″ custom_padding=”0|0px|54px|0px|false|false”][et_pb_row admin_label=”row” _builder_version=”3.0.47″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_padding=”0|0px|27px|0px|false|false”][et_pb_column type=”4_4″][et_pb_text _builder_version=”3.11″ header_text_color=”#ffffff” background_size=”initial” background_position=”top_left” background_repeat=”repeat” use_border_color=”off”]<\/p>\n
Suffering SQL Server Performance Issues?: A story of Olympic sprints and handy SQL Server hints!!!<\/strong> Usain Bolt, the world’s fastest runner, now boasts his third successive 100m Olympic title. That level of performance, the confidence in success when the pressure is at its greatest is an amazing achievement. However, the ability to start writing a blog on the performance level of Usain Bolt and then draw a very iffy link to SQL Server performance tuning surely has to surpass this. Some may say it\u2019s just a dirty, low down, good for nothing tactic \u2026. Well, yes, but, but, but… Read on, because when your business and colleagues are looking at you in anticipation, hoping, expecting, needing the database to perform during a critical trading period. Wouldn’t it be great to smile confidently and if the feeling takes you pull out an impromptu \u201cLighting Bolt\u201d swagger in the boardroom. Of course it would, so here are 5 handy hints to help you on the road to achieving stunning SQL Server performance: 1) Review your index usage:<\/strong> Make sure you review the missing\/redundant indexes as well as overlapping\/duplicate indexes which would cause unnecessary resource usage, thus preventing the best efficiency. 2) Make sure that your IO doesn\u2019t s*ck:<\/strong> Whilst PAGEIOLATCH is usually associated with disk IO throughput issues, it can also be caused by excessive TSQL query parallelism. This, however, is usually seen on systems with many logical cores where the max degree of parallelism is set to the default value of 0 (unlimited across all available cores). The disks (storage) can be overwhelmed by too much concurrency. Use Windows Perfmon to determine your read\/write latency. 3) Check tempdb is configured properly \u2013 default may not be the best option<\/strong>: The tempdb is not just used for the temporary tables you create but SQL Server engine uses it for sorting\/joining data, read committed snapshot isolation, availability groups, rebuild indexes in temp, etc. It’s important that the tempdb is configured properly. Prior to SQL Server 2016, by default you only start with 1 data file. But a good rule of thumb is:<\/p>\n Baseline and then check the performance upon change by monitoring Transactions\/sec counter against tempdb database on Windows Perfmon. Trace flags 1117 and 1118 could also help to get further performance benefits out of your tempdb. 4) Avoid zero-initialisation of data files<\/strong>: Another default setting of 1MB or 10% file autogrowth is one to change. A recommended approach to setting autogrowth would be as follows: Datafiles for user databases<\/span> \u2022 Primary should be 20mb, auto-growth 10%, size unlimited (it won\u2019t be used for user data) \u2022 Create secondary file group and make it the default file group (size unlimited) for the database with either: – 1 * 20mb file (increment by 10mb) for very small database <= 1GB – 1 * 100mb file (increment by 50mb) for small database <= 10GB – 2 * 500mb files (increment by 250mb) for medium database <= 100GB – 4 * 1GB files (increment by 500mb) for large database <= 500GB – 6 * 2GB files (increment by 500mb) for extra large database <= 1000GB – 8 * 3GB files (increment by 500mb) for super large database <= 1500GB Transaction logs for user databases<\/span> \u2022 Create transaction log file with either: – 1 * 50mb with 50mb (4 VLFs) increment for small database OR database in SIMPLE recovery mode, size unlimited – 1 * 500mb with 500mb (8 VLFs) increment for everything else, size unlimited When the data file grows SQL Server fills the newly allocated part of the file with zeroes, which is quite unnecessary. To prevent this part of the operation, you need to enable instant file initialisation i.e. grant the SQL Server service account \u201cPerform Volume Maintenance tasks\u201d privilege. This would mean that the newly created space can be used immediately. This only applies to the data file and not the transaction log file, which has to be zeroed out. 5) Schedule maintenance routines for optimal performance:<\/strong> De-fragmenting indexes and updating statistics on a regular basis is vital in enabling SQL Server to make accurate decisions on the execution plans to use. Hopefully these\u00a0tips come in useful and enjoy the rest of the Olympic games! If you do need a hand with a particularly difficult database performance issue then please give N4Stack a call<\/a>. [\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":" SQL Server Performance Suffering SQL Server Performance Issues?: A story of Olympic sprints and handy SQL Server hints!!! Usain Bolt, the world’s fastest runner, now boasts his third successive 100m Olympic title. That level of performance, the confidence in success when the pressure is at its greatest is an amazing achievement. However, the ability to […]<\/p>\n","protected":false},"author":1,"featured_media":4625,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":""},"categories":[484,344],"tags":[349],"yst_prominent_words":[1924,1916,1921,3200,1923,3198,1926,1920,64,409,1922,1918,570,175,1914,1927,1917,3199,1925,3201],"_links":{"self":[{"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/posts\/4615"}],"collection":[{"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/comments?post=4615"}],"version-history":[{"count":4,"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/posts\/4615\/revisions"}],"predecessor-version":[{"id":53548,"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/posts\/4615\/revisions\/53548"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/media\/4625"}],"wp:attachment":[{"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/media?parent=4615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/categories?post=4615"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/tags?post=4615"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"http:\/\/content.n4stack.io\/wp-json\/wp\/v2\/yst_prominent_words?post=4615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\n