<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vPivot &#187; perfmon</title>
	<atom:link href="http://vpivot.com/tag/perfmon/feed/" rel="self" type="application/rss+xml" />
	<link>http://vpivot.com</link>
	<description>Scott Drummonds on Virtualization</description>
	<lastBuildDate>Wed, 01 Feb 2012 06:46:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Inaccuracy of In-guest Performance Counters</title>
		<link>http://vpivot.com/2010/02/10/inaccuracy-of-in-guest-performance-counters/</link>
		<comments>http://vpivot.com/2010/02/10/inaccuracy-of-in-guest-performance-counters/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 23:33:43 +0000</pubDate>
		<dc:creator>drummonds</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[perfmon]]></category>
		<category><![CDATA[scheduler]]></category>
		<category><![CDATA[timekeeping]]></category>
		<category><![CDATA[vmkernel]]></category>

		<guid isPermaLink="false">http://vpivot.com/?p=268</guid>
		<description><![CDATA[Every couple of months I receive a request for an explanation as to why performance counters in a virtual machine cannot be trusted.  While it is unfairly cynical to say that in-guest counters are never right, accurate capacity management and troubleshooting should rely on the counters provided by vSphere in either vCenter or esxtop.  The [...]]]></description>
			<content:encoded><![CDATA[<p>Every couple of months I receive a request for an explanation as to why performance counters in a virtual machine cannot be trusted.  While it is unfairly cynical to say that in-guest counters are never right, accurate capacity management and troubleshooting should rely on the counters provided by vSphere in either <a href="http://communities.vmware.com/docs/DOC-5600">vCenter</a> or <a href="http://communities.vmware.com/docs/DOC-9279">esxtop</a>.  The explanation is too short to merit a white paper but I hope a blog article will serve as the authoritative comment on the subject.</p>
<p><span id="more-268"></span>Usually this issue arises inside a new VMware customer or an established customer that has added new staff to the virtualization team.  In both cases the administrators are familiar with existing tools and require good reason to retool their thinking and environment around a new measurement system.</p>
<p>I was discussing the response to these concerns with my friend and colleague Kaushik Banerjee, the head of VMware&#8217;s outbound engineering group.  Kaushik and I spend a lot of time thinking about communicating technical details to our customers and in this case we chose different approaches to answer the question.  Both responses are complementary, so choose the one that suits your needs.</p>
<h2>Kaushik&#8217;s Approach: The Killer Examples</h2>
<p>Kaushik suggested that if we show cases where the guest OS&#8217;s counters were obviously wrong that a naturally suspicious VI admin would never trust the guest counters again.  To that end, I offer the following screen shots to make our point.</p>
<div id="attachment_285" class="wp-caption alignnone" style="width: 610px"><a href="http://vpivot.com/wp-content/uploads/2010/02/utilization_guest_higher.jpg"><img class="size-full wp-image-285" title="Guest Utilization Higher Than Host" src="http://vpivot.com/wp-content/uploads/2010/02/utilization_guest_higher.jpg" alt="Guest Utilization Higher Than Host" width="600" /></a><p class="wp-caption-text">Perfmon&#39;s counters show utilization higher in the guest than the host reports.</p></div>
<p>This screen shot shows two counters available in Perfmon inside a Windows guest with the <a href="http://vpivot.com/2009/09/17/using-perfmon-for-accurate-esx-performance-counters">vmStatsProvider</a> installed (available by default since vSphere).  The darker, red line is the CPU utilization as reported by the guest.  The lighter, greenish (?) line is CPU utilization of the virtual machine, from the host&#8217;s perspective.  This is the real CPU utilization passed up to the host by vmStatsProvider.  Notice how the host is always reporting higher utilization than the guest.  This is due to one of the reasons why guest counters cannot be trusted: they are unaware of hypervisor overheads.</p>
<p>This second screen shot shows a different case where the host utilization is lower than that reported by the guest.  Again, the dark red line represents the guest OS&#8217;s report of CPU utilization and the lighter line shows the real CPU utilization as reported by ESX.</p>
<div id="attachment_284" class="wp-caption alignnone" style="width: 610px"><a href="http://vpivot.com/wp-content/uploads/2010/02/utilization_host_higher.jpg"><img class="size-full wp-image-284" title="Host Utilization Higher Than Guest" src="http://vpivot.com/wp-content/uploads/2010/02/utilization_host_higher.jpg" alt="Host Utilization Higher Than Guest" width="600" /></a><p class="wp-caption-text">Perfmon&#39;s counters report a higher CPU utilization than ESX&#39;s.</p></div>
<p>The reason the host shows lower utilization than the guest is because the guest is unaware that it is only getting a fraction of the host&#8217;s CPU, time-sliced by ESX&#8217;s scheduler.  In this case the virtual machine was contending for CPU with other active virtual machines but this just the same principle would apply had a CPU limit been set.</p>
<h2>Scott&#8217;s Approach: A Detailed Explanation</h2>
<p>My approach to convincing VI admins to avoid guest tools is based on bottomless thirst for information that is common to technophiles.  If I can provide an explanation for the underlying system of resource scheduling and manipulation, then our admins will be able to deal with the guest counter issue and maybe solve other issues with their newfound knowledge.</p>
<p>There are four reasons why guest counters cannot be trusted:</p>
<ol>
<li>The guest is unaware of virtualization overheads.  As screen shot one showed above, the hypervisor will increase the CPU load as it virtualizes the hardware for the guest operating system.  That additional CPU work is not seeing by guest tools.</li>
<li>The guest is unaware that it is only seeing the portion of CPU that ESX&#8217;s scheduler is allowing it to see.  Because of contention or resource restrictions, virtual machines only get a slice of the CPU&#8217;s time.  When a guest thinks it is getting 100% of the CPU it may not know that the processor is being shared by eight other virtual machines.  See the second screen shot above.</li>
<li>Time skew in virtual machines can change the sample window for time-based counters.  This means that the guest may have measured 10 milliseconds of time passage during a read command when 12 milliseconds have elapsed.  This is more common on older versions of ESX and when the host CPU is saturated.  More on this below.</li>
<li>The virtual machines are unaware that they are being de-scheduled when idle, which means that they appear to be working more of the time than they are.  Consider a case where a virtual machine is idle 90% of the time.  If ESX does not schedule the VM during its idle time then the guest will think that its processor queues are full 100% of the time that it is being executed.</li>
</ol>
<p>The time drift explanation (item three) was historically the most problematic for VMware.  On older versions of our products time drift was common.  As ESX has matured we have reduced the amount of drift which has improved the accuracy of guest counters.  But the timer hardware is still being virtualized in software running on the host CPU.  This means that if host processor is fully utilized, the timer may not be scheduled on time, resulting in a delay in some ticks and a resultant skew in guest time.</p>
<h2>References</h2>
<p><a href="https://www.vmware.com/pdf/VI3.5_Performance.pdf">Performance Best Practices and Benchmarking Guidelines</a>.  This white paper was the last version that we printed that included benchmarking best practices, which contains some discussion on the need to measure performance from outside the host-under-test.</p>
<p><a href="http://www.vmware.com/pdf/vmware_timekeeping.pdf">Timekeeping in Virtual Machines</a>.  This document&#8211;not updated since VI3 but still accurate in its theory&#8211;will give the background on VMware-based time keeping and provide an explanation as to how skew can occur.</p>
<p><a href="http://www.vmware.com/files/pdf/perf-vsphere-cpu_scheduler.pdf">VMware vSphere™ 4: The CPU Scheduler in VMware® ESX™ 4</a>.  This white paper provides great detail how the scheduler works which will fully explains the notion of time slicing.</p>
]]></content:encoded>
			<wfw:commentRss>http://vpivot.com/2010/02/10/inaccuracy-of-in-guest-performance-counters/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>VMware Perfmon Counters Missing on vSphere?</title>
		<link>http://vpivot.com/2010/01/26/vmware-perfmon-counters-missing-on-vsphere/</link>
		<comments>http://vpivot.com/2010/01/26/vmware-perfmon-counters-missing-on-vsphere/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 04:37:09 +0000</pubDate>
		<dc:creator>drummonds</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[perfmon]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://vpivot.com/?p=264</guid>
		<description><![CDATA[I was recently shown a problem where the ESX Perfmon counters we added to vSphere 4.0 virtual machines were not appearing in Windows virtual machines as of vSphere 4.0 U1.  The problem stems from an issue with mofcomp, which I will briefly describe below. For the impatient, the workaround is to manually uninstall and then [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently shown a problem where the ESX Perfmon counters we added to vSphere 4.0 virtual machines were not appearing in Windows virtual machines as of vSphere 4.0 U1.   The problem stems from an issue with mofcomp, which I will briefly describe below.  For the impatient, the workaround is to manually uninstall and then reinstall VMware Tools.  It also appears that the counters can be added by running <a href="http://e-scott.net/share/vmStatsProvider_006_release.exe">vmStatsProvider</a>, as I described in <a href="http://vpivot.com/2009/09/17/using-perfmon-for-accurate-esx-performance-counters/">a previous article</a>.</p>
<p><span id="more-264"></span><a href="http://msdn.microsoft.com/en-us/library/aa392389%28VS.85%29.aspx">mofcomp</a> is a tool provided by Microsoft and integrated with Windows that is used to register WMI classes such as VMware&#8217;s Perfmon counters with Windows.  For reasons that we do not entirely understand, but are tracking with a PR, mofcomp is failing during the tools upgrade on some systems.  Ideally a reinstall/upgrade/repair of VMware Tools will force a rerun of mofcomp and register the classes.  But the tools installer is not configured to do this today as a mofcomp failure was not anticipated by the developers that wrote the VMware Tools installer.</p>
<p>The key to the fix is to force mofcomp to run a second time.  This can be done in two ways:</p>
<ul>
<li>Uninstall VMware Tools and then reinstall them.  Unlike a reinstall (also called a &#8220;repair&#8221; or &#8220;upgrade&#8221;) this will force mofcomp to be run during the second install.  It should work the second time.  If it does not, I would be interested to know.</li>
<li>Install the counters using the <a href="http://ftpsite.vmware.com/download/drummonds/vmStatsProvider_006_release.exe">vmStatsProvider executable</a>, which <a href="http://vpivot.com/2009/09/17/using-perfmon-for-accurate-esx-performance-counters/">I documented previously</a>.</li>
</ul>
<p>Sorry for this problem, everyone.  We are tracking this issue and plan to improve the robustness of the installer as soon as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://vpivot.com/2010/01/26/vmware-perfmon-counters-missing-on-vsphere/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>esxtop Analysis With esxplot</title>
		<link>http://vpivot.com/2009/10/21/esxtop-analysis-with-esxplot/</link>
		<comments>http://vpivot.com/2009/10/21/esxtop-analysis-with-esxplot/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 21:02:30 +0000</pubDate>
		<dc:creator>drummonds</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[esxplot]]></category>
		<category><![CDATA[esxtop]]></category>
		<category><![CDATA[perfmon]]></category>

		<guid isPermaLink="false">http://vpivot.com/?p=135</guid>
		<description><![CDATA[esxtop remains a popular performance troubleshooting tool because of its fine granularity, expansive counter list, and support for interactive and off-line analysis. The biggest problem with esxtop is the huge CSV files generated in batch mode.  The output is so large that Excel is unable to open the file and Perfmon can take hours to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://communities.vmware.com/docs/DOC-9279">esxtop</a> remains a popular performance troubleshooting tool because of its fine granularity, expansive counter list, and support for interactive and off-line analysis.  The biggest problem with esxtop is the huge CSV files generated in batch mode.  The output is so large that Excel is unable to open the file and <a href="http://communities.vmware.com/docs/DOC-5100">Perfmon</a> can take hours to do so.  But now we have a better way to manage esxtop batch files.</p>
<p><span id="more-135"></span>A colleague of mine at VMware, Geoff White, wrote a Python-based tool for esxtop batch file analysis.  His tool, dubbed esxplot, provides a graphical interface to the data generated by esxtop&#8217;s batch mode.  esxplot provides search capabilities to find relevant counters, can plot different counters on the same graph, and does not suffer from the size limitations of Excel and Perfmon.</p>
<p>Geoff has graciously provided unsupported access to this tool&#8217;s beta version (version removed &#8212; see update below) for my readers.  Please test esxplot much as possible and comment here with your observations.  We would like to know of any bugs you discover as well as ideas for improvement.</p>
<p>The esxplot package comes with Windows and Ubuntu binaries as well as the Python source.  The binaries will run without need of additional libraries or tools.  But if you decide to use the Python script, as I have done on MacOS, you will need to verify the following:</p>
<ol>
<li>Ensure that you have Python 2.6 or greater, but not Python 3.x.</li>
<li>esxplot uses wxPython, which you can <a href="http://www.wxpython.org/download.php#binaries">download and install from here</a>.</li>
<li>esxplot also requires NumPy, available <a href="http://www.numpy.org/">here</a>.</li>
</ol>
<p>A manual is included in the package but I think you should find the interface simple and intuitive.  Here are a few tips to get you going:</p>
<ul>
<li>Load an esxtop batch file by specifying it on the command line or through File-&gt;Import-&gt;Dataset.</li>
<li>Using the counter navigator in the lower left corner, navigate to the counter of interest.  For instance, to view percent ready you would first expand the host  (use the triangle to the left of the host name), then expand &#8220;Group Cpu (GID:VM)&#8221;, then select &#8220;% Ready&#8221;.  The graph will be displayed on the right.</li>
<li>You can quickly find counters by entering a query search in the middle of the left panel.  This creates a new entry in the counter navigator that contains only counters whose name matches the expression you entered.  For instance, entering &#8220;ready&#8221; will create a counter query that contains all ready times in the batch file.</li>
</ul>
<p>Please let us know what you think of this wonderful tool.</p>
<h2>Update: 1/13/09</h2>
<p>esxplot version 1.0 was released on 1/13/09.  See <a href="http://vpivot.com/2010/01/13/esxplot-1-0-released/">the updated blog article</a> for information on that release and continued discussion on this tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://vpivot.com/2009/10/21/esxtop-analysis-with-esxplot/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Using Perfmon For Accurate, ESX Performance Counters</title>
		<link>http://vpivot.com/2009/09/17/using-perfmon-for-accurate-esx-performance-counters/</link>
		<comments>http://vpivot.com/2009/09/17/using-perfmon-for-accurate-esx-performance-counters/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 18:00:53 +0000</pubDate>
		<dc:creator>drummonds</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[perfmon]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://vpivot.com/?p=15</guid>
		<description><![CDATA[[An update to an old community post with more information on the tool.] My colleague in product management, Praveen Kannan, has been working to extend Perfmon to show some ESX performance counters. This capability is automatically installed with VMware Tools on vSphere 4. But Praveen and I have made a stand-alone version available to those [...]]]></description>
			<content:encoded><![CDATA[<p><em>[An update to an <a href="http://communities.vmware.com/blogs/drummonds/2009/06/18/using-perfmon-for-accurate-esx-performance-counters">old community post</a> with more information on the tool.]</em></p>
<p>My colleague in product management, Praveen Kannan, has been working to extend Perfmon to show some ESX performance counters.  This capability is automatically installed with VMware Tools on vSphere 4.  But Praveen and I have made a stand-alone version available to those of you that are still on VI3.  <a href="http://e-scott.net/share/vmStatsProvider_006_release.exe">Download it here</a> to give it a try.  [See note below if that link is dead.]</p>
<p><span id="more-15"></span>To install, place the file in an appropriately-named directory on any Windows VM on VI3.  Double-click the executable, which will self-extract the files into the same directory.  Run &#8220;install.bat&#8221; and you&#8217;re done.</p>
<p>Once you bring up Perfmon you&#8217;ll see two new performance objects on your computer: &#8220;VM Memory&#8221; and &#8220;VM Processor&#8221;.  These objects contain counters exposed by ESX that accurately reflect the VM&#8217;s memory and CPU usage.  Here&#8217;s Perfmon on my test VM after I&#8217;ve installed the tool.</p>
<p><img class="jive-image-thumbnail jive-image" src="http://communities.vmware.com/servlet/JiveServlet/downloadImage/38-4616-6039/new_counters.png" alt="new_counters.png" width="620" /></p>
<p>This makes collection of host stats a breeze.  Windows Management Instrumentation (WMI) programs can now easily get access to reliable host statistics.  And anyone with access to Perfmon can get see their VM&#8217;s resource usage.  Unlike guest-based statistics, the host-statistics shown through these counters accurately reflect resource usage in the presence of virtualization overheads and time slicing of VMs.</p>
<p>Disclaimer:</p>
<blockquote><p><em>This is a pre-release &#8220;sneak peak&#8221; version. Eventually this tool will be available for download on vmware.com and supported by VMware. But today there is no support for this tool and you&#8217;re using it &#8220;as-is&#8221;.  Use at your own risk and do not contact VMware support for help with this release.</em></p></blockquote>
<p>That&#8217;s VMware&#8217;s official position on this tool.  But feel free to comment here with any ideas about this great new feature.</p>
<h2>If the Download Link Is Dead</h2>
<p>Until the DLL is made available as a standalone product, we are hosting it on the VMware FTP server, which is swept regularly.  If the link is dead that means that the binary has been deleted to save space.  Leave me a comment here if you see this and I will again upload the binary for download.</p>
]]></content:encoded>
			<wfw:commentRss>http://vpivot.com/2009/09/17/using-perfmon-for-accurate-esx-performance-counters/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

