{"id":598,"date":"2011-03-09T10:42:00","date_gmt":"2011-03-09T10:42:00","guid":{"rendered":"\/blogs\/paul\/post\/Tempdb-configuration-survey-results.aspx"},"modified":"2017-04-13T09:51:25","modified_gmt":"2017-04-13T16:51:25","slug":"tempdb-configuration-survey-results-and-advice","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/","title":{"rendered":"Tempdb configuration survey results and advice"},"content":{"rendered":"<p>\n<font face=\"verdana,geneva\" size=\"2\">A few weeks ago I kicked off a survey about tempdb configuration &#8211; see <\/font><a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/survey-how-is-your-tempdb-configured\/\"><font face=\"verdana,geneva\" size=\"2\">here<\/font><\/a><font face=\"verdana,geneva\" size=\"2\"> for the survey. I received results for more than 600 systems! Here they are: <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">&nbsp;<img decoding=\"async\" src=\"\/blogs\/paul\/wp-content\/uploads\/2011\/3\/tempdb2.jpg\" alt=\"\" \/> <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">&nbsp;<img decoding=\"async\" src=\"\/blogs\/paul\/wp-content\/uploads\/2011\/3\/tempdb3.jpg\" alt=\"\" \/> <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">These are very interesting results, for several reasons: <\/font>\n<\/p>\n<ul>\n<li>\n<div>\n\t<font face=\"verdana,geneva\" size=\"2\">It shows the relative distribution of core-count for SQL Servers, with a pronounced shift to 8+ cores (55%), but still with a quarter of respondents using 4-core machines &#8211; they&#39;ve got a lot of life left in them. <\/font>\n\t<\/div>\n<\/li>\n<li>\n<div>\n\t<font face=\"verdana,geneva\" size=\"2\">It shows a result from someone with 128 cores on their server (at time of writing I didn&#39;t know what kind of machine, but the machine owner was kind enough to add a comment &#8211; it&#39;s an 8&#215;8 with hyperthreading enabled and 2TB memory!). <\/font>\n\t<\/div>\n<\/li>\n<li><font face=\"verdana,geneva\" size=\"2\">It shows that across the board, just over half of all servers are configured to have a single tempdb data file, regardless of the number of cores.<\/font><\/li>\n<li><font face=\"verdana,geneva\" size=\"2\">For the 7 systems with 48 or more cores, none had a single tempdb data file.<\/font><\/li>\n<\/ul>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">One of the hidden causes of poor performance can be incorrect tempdb configuration. There has been a lot of info posted about tempdb, so I don&#39;t want to repeat it here, but instead give you some pointers.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\"><font size=\"2\"><strong>Is tempdb I\/O a bottleneck?<\/strong> Use the <\/font><\/font><a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/ms190326.aspx\"><font face=\"verdana,geneva\" size=\"2\">sys.dm_io_virtual_file_stats<\/font><\/a><font face=\"verdana,geneva\" size=\"2\"> DMV (one of my favorites) to see the read\/write latencies. Jimmy May (<\/font><a href=\"http:\/\/blogs.msdn.com\/b\/jimmymay\/\"><font face=\"verdana,geneva\" size=\"2\">blog<\/font><\/a><font face=\"verdana,geneva\" size=\"2\">|<\/font><a href=\"https:\/\/twitter.com\/aspiringgeek\"><font face=\"verdana,geneva\" size=\"2\">twitter<\/font><\/a><font face=\"verdana,geneva\" size=\"2\">) has a great script using this DMV <\/font><a href=\"http:\/\/blogs.msdn.com\/b\/jimmymay\/archive\/2008\/10\/31\/drum-roll-please-the-debut-of-the-sql-dmv-all-stars-dream-team.aspx\"><font face=\"verdana,geneva\" size=\"2\">here<\/font><\/a><font face=\"verdana,geneva\" size=\"2\">&nbsp;that calculates per-I\/O latency for all files on a SQL Server instance.&nbsp;If you see latencies higher than you&#39;d expect from your I\/O subsystem (say 15ms or more), then you need to take action. Adding more files or moving tempdb to a faster I\/O subsystem is not necessarily the answer. It could be that you have some workload making use of tempdb that shouldn&#39;t be &#8211; e.g. a large sort or hash join operation that&#39;s spilling to tempdb, or someone using snapshot isolation in a database and causing a lot of read\/write activity because of the version store. Take a look at the whitepaper <\/font><a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/cc966545.aspx\"><font face=\"verdana,geneva\" size=\"2\">Working with tempdb in SQL Server 2005<\/font><\/a><font face=\"verdana,geneva\" size=\"2\">. It also applies to 2008 and will show you how to diagnose tempdb performance issues. If you know what&#39;s going on with tempdb and it all looks ok, then you will have to reconfigure tempdb. This could mean adding more files to allow I\/O parallelizing (just to be clear &#8211; I mean I\/Os being serviced by different portions of the I\/O subsystems, not multiple outstanding I\/O requests from SQL Server &#8211; which happens all the time), moving to faster storage, moving away from other database files. The solution will be different for everyone, but a <em>generalization<\/em> is to separate tempdb from other databases, and sometimes separate tempdb log from tempdb data files.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\"><font size=\"2\"><strong>Is tempdb allocation a bottleneck?<\/strong> This is where in-memory allocation bitmaps become a contention point with a workload that has many concurrent connections creating and dropping small temp tables. I&#39;ve discussed this many time &#8211; most recently&nbsp;in the post <\/font><\/font><a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/a-sql-server-dba-myth-a-day-1230-tempdb-should-always-have-one-data-file-per-processor-core\/\"><font face=\"verdana,geneva\" size=\"2\">A SQL Server DBA myth a day: (12\/30) tempdb should always have one data file per processor core<\/font><\/a><font face=\"verdana,geneva\" size=\"2\">. This post has lots of links to scripts where you can see if this is a problem for you, and discusses trace flag 1118 and how to work out the cores:tempdb-data-files ratio for your situation.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">Note: if you are going to add more tempdb data files, ensure that all tempdb data files are the same size. There is a known bug (which has been there forever and is in all versions) that if tempdb data files are not the same size, auto-growth will only occur on the largest file. You can work around that using trace flag 1117 (which forces all files to auto-grow at the same time) but that applies to *all* databases, just like trace flag 1118, which may not be the desired behavior.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">Bottom line: you&#39;ve only got one tempdb &#8211; take care of it!<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\"><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few weeks ago I kicked off a survey about tempdb configuration &#8211; see here for the survey. I received results for more than 600 systems! Here they are: &nbsp; &nbsp; These are very interesting results, for several reasons: It shows the relative distribution of core-count for SQL Servers, with a pronounced shift to 8+ [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,52,91,93],"tags":[],"class_list":["post-598","post","type-post","status-publish","format-standard","hentry","category-database-maintenance","category-involuntary-dba","category-surveys","category-tempdb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tempdb configuration survey results and advice - Paul S. Randal<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tempdb configuration survey results and advice - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"A few weeks ago I kicked off a survey about tempdb configuration &#8211; see here for the survey. I received results for more than 600 systems! Here they are: &nbsp; &nbsp; These are very interesting results, for several reasons: It shows the relative distribution of core-count for SQL Servers, with a pronounced shift to 8+ [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2011-03-09T10:42:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T16:51:25+00:00\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/\",\"name\":\"Tempdb configuration survey results and advice - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2011-03-09T10:42:00+00:00\",\"dateModified\":\"2017-04-13T16:51:25+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tempdb configuration survey results and advice\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tempdb configuration survey results and advice - Paul S. Randal","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/","og_locale":"en_US","og_type":"article","og_title":"Tempdb configuration survey results and advice - Paul S. Randal","og_description":"A few weeks ago I kicked off a survey about tempdb configuration &#8211; see here for the survey. I received results for more than 600 systems! Here they are: &nbsp; &nbsp; These are very interesting results, for several reasons: It shows the relative distribution of core-count for SQL Servers, with a pronounced shift to 8+ [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/","og_site_name":"Paul S. Randal","article_published_time":"2011-03-09T10:42:00+00:00","article_modified_time":"2017-04-13T16:51:25+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/","name":"Tempdb configuration survey results and advice - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2011-03-09T10:42:00+00:00","dateModified":"2017-04-13T16:51:25+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/tempdb-configuration-survey-results-and-advice\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Tempdb configuration survey results and advice"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/598","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=598"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/598\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}