<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>EMEA Windows Performance</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/emeaperf/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/emeaperf/feed.xml</link>
    <description>Windows Performance Tips and Tricks</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:06:49 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>My system is having high CPU without any explanation and Task Manager does not add up. What can I do?</title>
      <link>https://docs.microsoft.com/archive/blogs/emeaperf/my-system-is-having-high-cpu-usage-without-any-explanation-and-task-manager-does-not-add-up-what-can-i-do</link>
      <pubDate>Wed, 06 Dec 2017 11:35:56 GMT</pubDate>
      <dc:creator><![CDATA[Alexandru Mircea Popescu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/emeaperf/?p=65</guid>
      <description><![CDATA[Today I would like to briefly discuss about what should be collected in a high CPU issue, where the...]]></description>
      <content:encoded><![CDATA[Today I would like to briefly discuss about what should be collected in a high CPU issue, where the reason cannot be identified using Task Manager and / or <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer">Process Explorer</a>.

We see a lot of these issues coming in and I want to provide some useful guidelines about systems that are randomly having High CPU.

If you are thinking about opening a case with Microsoft, here is some initial data that you can gather before the call is open.

<strong>What can I do to find out what is happening?</strong>

What most Microsoft engineers will ask, in a high CPU scenario, will be to create a trace, while the issue is present, with a tool called XPerf.

<strong>What is Xperf? </strong>

Xperf is a performance tracing tool based on Event Tracing for Windows, using low overhead, so it will have a minimal impact on the system performance.

More details can be found also at: <a href="https://blogs.technet.microsoft.com/askperf/2008/06/27/two-minute-drill-introduction-to-xperf/">https://blogs.technet.microsoft.com/askperf/2008/06/27/two-minute-drill-introduction-to-xperf/</a>

<strong>How to get Xperf:</strong>

Xperf is part of Windows Assessment and Deployment Kit (<a href="https://www.microsoft.com/en-us/download/details.aspx?id=39982">Windows ADK</a>) and we will need to install it on a system, preferable on a Test system and retrieve some files.

Once ADK is installed, navigate to the installation location (default “<em>C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit</em>”) and retrieve the “xperf.exe” and “perfctrl.dll” files. Now, we can transfer these files to any system which need to be investigated for a high CPU issue.

<strong>Now that I have XPerf files, what’s next? </strong>

Wait for the high CPU issue to repeat and do the following:
<ul>
 	<li>Open an elevated command prompt and navigate to the XPerf location</li>
 	<li>Execute: Xperf -on latency -stackwalk profile</li>
 	<li>Leave the trace running for three to five minutes (don’t close the command prompt)</li>
 	<li>Stop the trace by executing: Xperf -d c:\temp\highcpu.etl (location can be changed to another folder, but the folder needs to exist prior to execution of the command)</li>
</ul>
If you would like to analyze the trace, simply move it to the system where you have installed the ADK tool and open the trace with Windows Performance Analyzer.

***

<strong>Please Note:</strong>
<ul>
 	<li>XPerf is not the only tool that can be used in this type of scenarios</li>
 	<li>Performance Monitor traces can also be set to capture a trace while the CPU utilization is high</li>
 	<li>Some Microsoft engineer may ask you to create different traces, depending on the issue description and preference</li>
</ul>
&nbsp;

-- Alex]]></content:encoded>
    </item>
    <item>
      <title>My system is randomly freezing / hanging without any explanation. What can I do?</title>
      <link>https://docs.microsoft.com/archive/blogs/emeaperf/my-system-is-randomly-freezing-hanging-without-any-explanation-what-can-i-do</link>
      <pubDate>Tue, 21 Nov 2017 12:04:23 GMT</pubDate>
      <dc:creator><![CDATA[Alexandru Mircea Popescu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/emeaperf/?p=35</guid>
      <description><![CDATA[Hello, my name is Mircea - Alexandru Popescu, and I am a Support Engineer with the Windows Core...]]></description>
      <content:encoded><![CDATA[Hello, my name is Mircea - Alexandru Popescu, and I am a Support Engineer with the Windows Core Performance EMEA team.

We see a lot of this issue coming in and I was thinking to provide some useful guidelines about systems entering an unresponsive state and what data is required by Microsoft engineers to start troubleshooting.

<strong>What is an OS hanging state?</strong>

A few causes of a system hang can be:
- resource exhaustion (CPU, memory, disk)
- the OS is too busy working exclusively on something (high priority threads, spinlocks, waiting of an event, etc.)
- hardware error
<strong> </strong>
<strong>So, what can I do to find out what is happening?</strong>

Usually, so that the business is broth up as fast as possible and the impact minimized, the first thing a customer will do is to hard reboot the OS.<span style="text-decoration: line-through"></span>
If your goal is only to minimize the impact and have the server up and running as fast as possible, this is OK. However, if you would also like to find out the cause of the hang, then there are a few things that need to be done prior to rebooting the server.

So, what can we do before rebooting the OS to ensure Microsoft support has all the correct data to start the troubleshooting?
Well, to see what is going on, we need to look at the server’s memory. This will give us an idea of what was happening at the time of the hang. To do this, we need to obtain a memory dump of the server in the hang state.

Depending on if the server is physical or virtual we can do the following:

<strong>For the physical systems, we will need to configure some registry keys before the issue occurs or after we have rebooted the server for recovery. If it is done after the server has been rebooted for recovery, then we will need to wait for another occurrence to gather the necessary data. </strong>

1) Start Registry Editor

2) Locate the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters

3) On the Edit menu, click Add Value, and then add the following registry value:
Name: CrashOnCtrlScroll
Type: REG_DWORD
Data: 1

4) Locate the following key in the registry:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\kbdhid\Parameters

5) On the Edit menu, click Add Value, and then add the following registry value:
Name: CrashOnCtrlScroll
Type: REG_DWORD
Data: 1

6) Locate the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl

7) On the Edit menu, click Add Value, and then add the following registry value:
Name: NMICrashDump
Type: REG_DWORD
Data: 1

8) Quit Registry Editor &amp; reboot

<strong>When the system hang occurs, hold down the </strong><strong>right-hand CTRL key</strong><strong> and hit SCROLL LOCK twice to bugcheck the machine (STOP 0xE2).</strong>
*

Taking the dump <strong>too soon</strong> may not reveal anything, as the wait times may not be sufficient to "raise a flag". So we do recommend to wait at least ~20 minutes before creating the memory dump.

<strong>**</strong>

The keyboard combination will only work if the keyboard is attached to the system <strong>before </strong>we encounter the issue.

Having a keyboard connected through a KVM to the server may also not work. We recommend that the keyboard is directly connected to the machine.

<strong>***</strong>
<strong>a/ Ensure that the system is set to create a “Kernel memory dump” or “Complete memory dump”</strong>
While “Complete memory dump” would be the recommended setting, because it contains all the memory loaded at the time of the memory dump creation, for system with a lot of memory this could cause an issue, due to the space required.<strong> </strong>

<strong>For more details, about how to configure the memory dump and what is the disk space required, see below article:</strong>
<a href="https://support.microsoft.com/en-us/help/969028/how-to-generate-a-kernel-or-a-complete-memory-dump-file-in-windows-ser">https://support.microsoft.com/en-us/help/969028/how-to-generate-a-kernel-or-a-complete-memory-dump-file-in-windows-ser</a>

<strong>b/ For Physical system that have a management console and where we cannot use the keyboard combination, we can use the NMI trigger.</strong>

The above changes will configure the server to accept the key combination (right CTRL + Scroll Lock twice) and the NMI, that will send an interrupt request with the highest priority, which in the end will trigger the memory dump.

<strong>For the virtual machines, the way we can collect the data is much simpler.</strong>

<strong>I/ Hyper-V (2008 / 2008 R2 / 2012 / 2012 R2):</strong>

a/ Open Hyper-V manager and select the affected VM
b/ Create a checkpoint of the VM while the hanging state is present
* As much as possible, wait approximately 15 – 20 minutes, before creating the checkpoint.

c/ Browse to the appropriate folder that corresponds to your VM and save the .VSS and .BIN files

<strong>***Now, why do we ask for the .VSS and .BIN files, and what do we do with them:</strong>

Using internal tools, we are going to convert the files into a memory dump. Unfortunately, the tool is no longer available for download. As an alternative, you can use the LiveKD, which is a free Sysinternals tool, if you prefer not to send the files to Microsoft support or if you would like to debug locally.

For more details about how to use and where to download the LiveKD, see:
<a href="https://blogs.msdn.microsoft.com/vimalsdesk/2014/11/23/taking-a-dump-of-a-vm-running-on-hyper-v/">https://blogs.msdn.microsoft.com/vimalsdesk/2014/11/23/taking-a-dump-of-a-vm-running-on-hyper-v/</a>

<strong>II/ Hyper-V 2016:</strong>

a/ Open Hyper-V manager and select the affected VM
b/ Create a checkpoint of the VM while the hanging state is present
* As much as possible, wait approximately 20 – 25 minutes before creating the checkpoint

c/ Browse to the appropriate folder that corresponds to your VM and save the following files to a different location:

.vmcx
.vmrs
.avhdx
.avhdx.mrt
.avhdx.rct

<strong>III/ VMWare VM (ESX / ESXi under version 6.0) </strong>
<ol>
 	<li>Login to the vCenter Server or ESXi host using vSphere Client or vSphere Web Client</li>
 	<li>Select the Virtual Machine</li>
 	<li>Create a Snapshot of the VM or alternative place the VM into Suspend State.</li>
 	<li>Based on the option selected above, in the virtual machine directory, you will find a .vmsn (snapshot) or a .vmss (suspend state) file.</li>
 	<li>Save the files to a different location</li>
</ol>
***

As in the Hyper-V scenario, VMWare provides a tool called VMSS2Core, so we can convert the snapshot / suspend state into a memory dump. Again, the conversion can be done locally, if preferred.
More details about the VMSS2CORE tool: <a href="https://labs.vmware.com/flings/vmss2core">https://labs.vmware.com/flings/vmss2core</a>
VMWare article: <a href="https://kb.vmware.com/s/article/2003941">https://kb.vmware.com/s/article/2003941</a>

<strong>IV/ For ESX / ESXi version 6.0 and above:</strong>

As in ESXi under version 6.0, the steps are the same, the only difference is in the files needed to be converted into a memory dump. After ESXi version 6.0, there is an additional file required, .VMEM, for the conversion to work.

&nbsp;

<strong>***</strong>

<strong>Additional details that can help in troubleshooting and can provide a faster resolution:</strong>
<ol>
 	<li>What are the recent changes (application updates, hardware, network, etc.)</li>
 	<li>When did you first notice this and how</li>
 	<li>Any pattern noticed?</li>
 	<li>Have you updated all binaries to the latest version (MS and all Third-Party) on the affected machine as well as the firmware BIOS?</li>
 	<li>What was the system doing at the time of the issue (idle, backup, normal work, under heavy load, etc.)?</li>
</ol>
&nbsp;

-- Alex]]></content:encoded>
    </item>
    <item>
      <title>Bugcheck 0x7F (UNEXPECTED_KERNEL_MODE_TRAP) when migrating Hyper-V VMs between hosts</title>
      <link>https://docs.microsoft.com/archive/blogs/emeaperf/bugcheck-0x7f-unexpected_kernel_mode_trap-when-migrating-hyper-v-vms-between-hosts</link>
      <pubDate>Tue, 21 Nov 2017 12:03:31 GMT</pubDate>
      <dc:creator><![CDATA[Adrian Zamfirescu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/emeaperf/?p=45</guid>
      <description><![CDATA[Hi, my name is Adrian and I am a Support Escalation Engineer with the EMEA Performance team.

I've...]]></description>
      <content:encoded><![CDATA[Hi, my name is Adrian and I am a Support Escalation Engineer with the EMEA Performance team.

I've seen an increased number of cases recently where customers have issues with Hyper-V systems crashing with a BugCheck code 0x7F (UNEXPECTED_KERNEL_MODE_TRAP) when trying to move a VM from one host to another.

In the scenarios I've seen both the source and destination hosts would go down at the same time.

In case you hit this issue, one of the first things to check is that the antivirus on the box has the proper exclusions setup for Hyper-V.

There is a list with all AV exclusions for Hyper-V hosts <a href="https://support.microsoft.com/en-us/help/3105657/recommended-antivirus-exclusions-for-hyper-v-hosts">here</a>.

Add the proper exclusion and see if the issue reoccurs.

Hope this helps!]]></content:encoded>
    </item>
  </channel>
</rss>