{"id":102421,"date":"2019-04-17T07:00:00","date_gmt":"2019-04-17T14:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=102421"},"modified":"2019-06-06T17:43:47","modified_gmt":"2019-06-07T00:43:47","slug":"20190417-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20190417-00\/?p=102421","title":{"rendered":"What does this strange value for &#8220;Percent CPU&#8221; mean in Performance Monitor?"},"content":{"rendered":"<p>A customer was monitoring the CPU usage of one of their processes in the Performance Monitor tool, and they got a pretty graph and this summary: <\/p>\n<div STYLE=\"padding-bottom: 1pc\"><\/div>\n<table BORDER=\"0\" CLASS=\"cp3\" CELLPADDING=\"3\" CELLSPACING=\"0\" STYLE=\"border-collapse: collapse\">\n<tr>\n<td COLSPAN=\"6\" STYLE=\"padding-bottom: 1ex\">Average: <span STYLE=\"border: solid 1px black;padding: 1px\">&#x2007;&#x2007;271,828<\/span> &nbsp; Minimum: <span STYLE=\"border: solid 1px black;padding: 1px\">&#x2007;&#x2007;&#x2007;&#x2007;0,000<\/span> &nbsp; Maximum: <span STYLE=\"border: solid 1px black;padding: 1px\">&#x2007;3.141,592<\/span>     <\/td>\n<\/tr>\n<tr>\n<td STYLE=\"border: solid 1px gray\">Scale<\/td>\n<td STYLE=\"border: solid 1px gray\">Counter<\/td>\n<td STYLE=\"border: solid 1px gray\">Instance<\/td>\n<td STYLE=\"border: solid 1px gray\">Parent<\/td>\n<td STYLE=\"border: solid 1px gray\">Object<\/td>\n<td STYLE=\"border: solid 1px gray\">Computer<\/td>\n<\/tr>\n<tr>\n<td STYLE=\"border-bottom: solid 1px black;border-left: solid 1px black\">0,1<\/td>\n<td STYLE=\"border-bottom: solid 1px black\">% Processor Time<\/td>\n<td STYLE=\"border-bottom: solid 1px black\">myapp<\/td>\n<td STYLE=\"border-bottom: solid 1px black\">&#8212;<\/td>\n<td STYLE=\"border-bottom: solid 1px black\">Process<\/td>\n<td STYLE=\"border-bottom: solid 1px black;border-right: solid 1px black\">\\\\MYPC<\/td>\n<\/tr>\n<\/table>\n<p>What did the process consume 271828 of? What does this number mean in the context of percent processor time? <\/p>\n<p>FIrst thing to notice is that the comma is a decimal separator, not a thousands separator. You see a clue there in the <i>Scale<\/i> column, where it says &#8220;0,1&#8221;. Also in the <i>Maximum<\/i>, where it says &#8220;3.141,592&#8221;, where the period after the &#8220;3&#8221; makes no sense if the comma were a decimal separator. Nope, this information is displayed according to a locale where the comma is the decimal separator and the period is the thousands separator. <\/p>\n<p>Okay, so that unwraps one layer of the onion. We were misreading the value. It&#8217;s actually 271.828. But 271.828 what? <\/p>\n<p>The next clue is that <i>Scale<\/i>. It is set to 0.1, which means that the displayed value is tenths of a unit. So you didn&#8217;t consume 271.828 units, but rather 271.828 tenths of a unit, or 27.1828 units. <\/p>\n<p>The next clue is that the value itself is called <i>% Processor Time<\/i>, which tells you that that it is reporting in percentage of processor time. <\/p>\n<p>Therefore, this process consumed 27% of a processor on average during the period under measurement. The maximum was 3141.592 &times; 0.1 = 314.1592 percent of a processor. In other words, during its peak, the process used the equivalent of 3.14 processors. (One can infer, then, that this system has at least four processors.) <\/p>\n<p>To get to the final answer, we had to go through three layers: <\/p>\n<ol>\n<li>Parse the value correctly.<\/li>\n<li>Adjust for the scale factor.<\/li>\n<li>Interpret the value as a percentage.<\/li>\n<\/ol>\n<p><b>Related<\/b>: <a HREF=\"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/20160219-00\/?p=93052\">When I try to calculate a performance counter manually, the answer is off by a factor of 100<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s the percent CPU, but you have to undo the various adjustments you requested.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-102421","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>It&#8217;s the percent CPU, but you have to undo the various adjustments you requested.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/102421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=102421"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/102421\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=102421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=102421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=102421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}