{"id":529,"date":"2011-10-19T11:04:00","date_gmt":"2011-10-19T11:04:00","guid":{"rendered":"\/blogs\/paul\/post\/Page-Life-Expectancy-isnt-what-you-think.aspx"},"modified":"2020-05-03T17:05:55","modified_gmt":"2020-05-04T00:05:55","slug":"page-life-expectancy-isnt-what-you-think","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/page-life-expectancy-isnt-what-you-think\/","title":{"rendered":"Page Life Expectancy isn&#8217;t what you think&#8230;"},"content":{"rendered":"<p>(New\u00a0for 2020: we\u2019ve published a range of SQL Server interview candidate screening assessments with our partner Kandio, so you can avoid hiring an \u2018expert\u2019 who ends up causing problems. Check them out\u00a0<a href=\"https:\/\/kand.io\/tests\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.)<\/p>\n<p style=\"text-align: justify;\">Updated 5\/11\/2015&#8230;<\/p>\n<p style=\"text-align: justify;\">There&#8217;s a lot of controversy about the Buffer Manager performance object counter Page Life Expectancy &#8211; mostly around people continuing to quote 300 as a threshold for starting to worry about there being a problem (which is just utter nonsense these days). That&#8217;s far too *low* to be the point at which to start worrying if your PLE dips and stays there. Jonathan came up with a better number to use &#8211; based on the size of your buffer pool &#8211; see the bottom of his post <a href=\"https:\/\/www.sqlskills.com\/blogs\/jonathan\/post\/finding-what-queries-in-the-plan-cache-use-a-specific-index.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<p style=\"text-align: justify;\">But that&#8217;s not why I&#8217;m writing today: I want to explain why most of the time now Page Life Expectancy is really not giving you useful information.<\/p>\n<p style=\"text-align: justify;\">Most new systems today use NUMA, and so the buffer pool is split up and managed per NUMA node, with each NUMA node getting it&#8217;s own lazy writer thread, managing it&#8217;s own buffer free list, and dealing with node-local memory allocations. Think of each of these as a mini buffer pool.<\/p>\n<p style=\"text-align: justify;\">The Buffer Manager:Page Life Expectancy counter is calculated by adding the PLE of each mini buffer pool and then calculating\u00a0the mean. But it&#8217;s not the\u00a0arithmetic mean as we&#8217;ve all thought forever, it&#8217;s the\u00a0harmonic mean (see Wikipedia <a href=\"https:\/\/en.wikipedia.org\/wiki\/Harmonic_mean\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>), so the value is lower than the arithmetic mean. (5\/11\/2015: Thanks to Matt Slocum (<a href=\"http:\/\/www.sqlmatt.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">b<\/a> | <a href=\"https:\/\/mobile.twitter.com\/slocummatt\" target=\"_blank\" rel=\"noopener noreferrer\">t<\/a>) for pointing out a discrepancy from the arithmetic mean on a large NUMA system and making me dig into this more, and my friend Bob Dorr from CSS for digging into the code.)<\/p>\n<p style=\"text-align: justify;\">What does this mean? It means that the overall PLE is not giving you a true sense of what is happening on your machine as one NUMA node could be under memory pressure but the *overall* PLE would only dip slightly. One of my friends who&#8217;s a Premier Field Engineer and MCM just had this situation today, which prompted this blog post. The conundrum was how can there be 100+ lazy writes\/sec occurring when overall PLE is relatively static &#8211; and this was the issue.<\/p>\n<p style=\"text-align: justify;\">For instance, for a machine with\u00a04 NUMA nodes, with PLE of each being 4000, the overall PLE is 4000.<\/p>\n<p style=\"text-align: justify;\">The calculation is: add the reciprocals of (1000 x PLE) for each node, divide that into the number of nodes and then divide by 1000.<\/p>\n<p style=\"text-align: justify;\">In my example, this is 4 \/ (1\/(1000 x 4000) +\u00a01\/(1000 x 4000) +\u00a01\/(1000 x 4000) +\u00a01\/(1000 x 4000)) \/ 1000 = 4000.<\/p>\n<p style=\"text-align: justify;\">Now, if one of them drops to 2200, the overall PLE only drops to:\u00a04 \/ (1\/(1000 x 2200) +\u00a01\/(1000 x 4000) +\u00a01\/(1000 x 4000) +\u00a01\/(1000 x 4000)) \/ 1000 = 3321.<\/p>\n<p style=\"text-align: justify;\">If you had an alert set watching for a 20% drop in PLE then that wouldn&#8217;t fire, even though one of the buffer nodes was under high pressure.<\/p>\n<p style=\"text-align: justify;\">And you have to be careful not to overreact too. If one of them drops to 200, the overall PLE only drops to:\u00a04 \/ (1\/(1000 x 200) +\u00a01\/(1000 x 4000) +\u00a01\/(1000 x 4000) +\u00a01\/(1000 x 4000)) \/ 1000 = 695, which might make you think that the server is suffering hugely across the board.<\/p>\n<p style=\"text-align: justify;\">On NUMA machines, you need to be looking at the Buffer Node:Page Life Expectancy counters for all NUMA nodes otherwise you&#8217;re not getting an accurate view of buffer pool memory pressure and so could be missing or overreacting to performance issues. And adjust Jonathan&#8217;s threshold value according to the number of NUMA nodes you have.<\/p>\n<p style=\"text-align: justify;\">You can see the lazywriter activity for each NUMA node by looking for the lazywriter threads in sys.dm_exec_requests.<\/p>\n<p style=\"text-align: justify;\">Hope this helps!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(New\u00a0for 2020: we\u2019ve published a range of SQL Server interview candidate screening assessments with our partner Kandio, so you can avoid hiring an \u2018expert\u2019 who ends up causing problems. Check them out\u00a0here.) Updated 5\/11\/2015&#8230; There&#8217;s a lot of controversy about the Buffer Manager performance object counter Page Life Expectancy &#8211; mostly around people continuing to [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,66],"tags":[],"class_list":["post-529","post","type-post","status-publish","format-standard","hentry","category-buffer-pool","category-performance-tuning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Page Life Expectancy isn&#039;t what you think... - 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\/page-life-expectancy-isnt-what-you-think\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Page Life Expectancy isn&#039;t what you think... - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"(New\u00a0for 2020: we\u2019ve published a range of SQL Server interview candidate screening assessments with our partner Kandio, so you can avoid hiring an \u2018expert\u2019 who ends up causing problems. Check them out\u00a0here.) Updated 5\/11\/2015&#8230; There&#8217;s a lot of controversy about the Buffer Manager performance object counter Page Life Expectancy &#8211; mostly around people continuing to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/page-life-expectancy-isnt-what-you-think\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2011-10-19T11:04:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-04T00:05:55+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\/page-life-expectancy-isnt-what-you-think\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/page-life-expectancy-isnt-what-you-think\/\",\"name\":\"Page Life Expectancy isn't what you think... - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2011-10-19T11:04:00+00:00\",\"dateModified\":\"2020-05-04T00:05:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/page-life-expectancy-isnt-what-you-think\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/page-life-expectancy-isnt-what-you-think\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/page-life-expectancy-isnt-what-you-think\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Page Life Expectancy isn&#8217;t what you think&#8230;\"}]},{\"@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":"Page Life Expectancy isn't what you think... - 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\/page-life-expectancy-isnt-what-you-think\/","og_locale":"en_US","og_type":"article","og_title":"Page Life Expectancy isn't what you think... - Paul S. Randal","og_description":"(New\u00a0for 2020: we\u2019ve published a range of SQL Server interview candidate screening assessments with our partner Kandio, so you can avoid hiring an \u2018expert\u2019 who ends up causing problems. Check them out\u00a0here.) Updated 5\/11\/2015&#8230; There&#8217;s a lot of controversy about the Buffer Manager performance object counter Page Life Expectancy &#8211; mostly around people continuing to [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/page-life-expectancy-isnt-what-you-think\/","og_site_name":"Paul S. Randal","article_published_time":"2011-10-19T11:04:00+00:00","article_modified_time":"2020-05-04T00:05:55+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\/page-life-expectancy-isnt-what-you-think\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/page-life-expectancy-isnt-what-you-think\/","name":"Page Life Expectancy isn't what you think... - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2011-10-19T11:04:00+00:00","dateModified":"2020-05-04T00:05:55+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/page-life-expectancy-isnt-what-you-think\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/page-life-expectancy-isnt-what-you-think\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/page-life-expectancy-isnt-what-you-think\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Page Life Expectancy isn&#8217;t what you think&#8230;"}]},{"@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\/529","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=529"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/529\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}