监视虚拟机上的代码改动模式Monitoring churn patterns on virtual machines

本文概述了可用于监视虚拟机上的代码改动模式的各种工具。This article provides an overview of various tools that can be used to monitor churn patterns on a virtual machine. 通过使用适当的工具,可轻松精准地找出导致大量改动的应用程序,然后可对该应用程序执行进一步的操作。By using proper tools, it is easy to find out exactly which application is causing high churn and then further actions for that application can be taken.

对于 Azure 虚拟机(Windows 或 Linux)For Azure virtual machines (Windows or Linux)

如果计算机托管在 Azure 中,并且使用托管或非托管磁盘进行存储,则可通过跟踪磁盘指标轻松跟踪性能。If your machine is hosted in Azure and is using a managed or unmanaged disk for storage, then you can easily track performance, by tracking disk metrics. 这样,你能够密切监视并根据应用程序使用模式选择适当的磁盘。This enables you to closely monitor and make the right disk selection to suit your application usage pattern. 你还可用它来创建警报、诊断和生成自动化。You can also use it to create alerts, diagnosis, and build automation. 了解详细信息Learn more.

使用 Azure Site Recovery 保护计算机后,可使用 Azure Monitor 日志和 Log Analytics 监视计算机。Once you have protected your machines with Azure Site Recovery, you can monitor your machines by using Azure Monitor Logs and Log Analytics. 了解详细信息Learn more.

还有一些特定于操作系统的工具可供使用。There are also some operating system-specific tools that you can use.

对于 Windows 计算机For Windows machines

如果有一台运行 Windows 操作系统的计算机(无论是否在本地),则有其他一些工具可供使用。In case you have a machine, be it on-premises or not, which is running Windows operating system, then there are a few more tools available.

除了在任务管理器上检查磁盘使用情况之外,还始终可参考资源监视器和性能监视器 。Apart from checking the disk usage on Task Manager, you can always refer to Resource Monitor and Performance Monitor. Windows 计算机上已存在这些工具。These tools are already present on Windows machines.

资源监视器Resource Monitor

资源监视器实时显示硬件和软件资源使用情况的相关信息。Resource Monitor displays information about the use of hardware and software resources in real time. 若要在 Windows 计算机上运行资源监视器,请执行以下步骤 -To run Resource Monitor on a Windows machine, follow the below steps -

  1. 按 Win + R,然后键入“resmon”。Press Win + R and type resmon.

  2. resmon(即资源监视器)窗口打开后,请切换到“磁盘”选项卡。它提供以下视图 -Once the resmon, that is, Resource Monitor, window opens switch to the Disk tab. It gives following view -

    资源监视器的“磁盘”选项卡

  3. 必须连续监视此选项卡一段时间,才能获得清晰的图像。This tab must be monitored continuously for some time to obtain a clear picture. 在上面的示例中,我们发现 wmiprv.exe 改动量大。In the above example, we see that wmiprv.exe is churning high.

一旦识别出导致计算机改动量大的应用程序,就可采取必要的措施来解决与这些应用程序相关的改动。Once you have identified the applications causing high churn on your machine, you can take necessary actions to tackle the churn related to those applications.

性能监视器Performance Monitor

性能监视器会监视计算机上的各种活动,例如 CPU 或内存使用情况。Performance Monitor monitors various activities on a computer such as CPU or memory usage. 若要在 Windows 计算机上运行性能监视器,请执行以下步骤 -To run Performance Monitor on a Windows machine, follow the below steps -

  1. 按 Win + R,然后键入“perfmon”。Press Win + R and type perfmon.

  2. perfmon(即性能监视器)窗口打开后,将提供以下视图 -Once the perfmon, that is, Performance Monitor, window opens, it gives following view -

    性能监视器步骤 1

  3. 展开右侧的“监视工具”文件夹,然后单击“性能监视器”。Expand the Monitoring Tools folder on the right and click on Performance Monitor. 这将打开以下视图,让你了解当前性能的实时信息 -This will open the below view giving you a real-time information about the current performance -

    性能监视器步骤 2

  4. 该图当前仅监视一个监视器,即“处理器时间百分比”,如该图正下方的表格所示。This graph is currently monitoring just one monitor, that is, the '% Processor Time' - as indicated by the table right below the graph. 可单击工具顶部的“+”符号,添加更多要监视的项。You can add more items for monitoring by clicking on the '+' on top of the tool.

  5. 下面直观显示了在向其添加更多计数器后性能监视器的外观 -Below is a visual of how Performance Monitor looks like once we add more counters to it -

    性能监视器步骤 3

此处详细了解性能监视器。Learn more about Performance Monitor here.

对于 Linux 计算机For Linux machines

如果有一台运行 Linux 操作系统的计算机(无论是否在本地),则可使用其他一些工具来监视改动模式。In case you have a machine, be it on-premises or not, which is running Linux operating system, then there are a few more tools available to monitor the churn patterns.

IotopIotop

最常用的工具之一是 iotop。One of the most used tools is iotop. 它是用于显示实时磁盘活动的实用工具。It is a utility for displaying real-time disk activity. 它可列出正在执行 I/O 的进程及其正在使用的磁盘带宽。It can list the processes that are performing I/O, along with the disk bandwidth they are using.

打开命令提示符并运行命令 iotopOpen the command prompt and run the command iotop .

IoStatIoStat

IoStat 是一款简单的工具,用于收集和显示系统输入和输出存储设备统计信息。IoStat is simple tool that will collect and show system input and output storage device statistics. 此工具通常用于跟踪存储设备性能问题,包括设备、本地磁盘和远程磁盘。This tool is often used to trace storage device performance issues including devices, local disks, remote disks.

打开命令提示符并运行命令 iostatOpen the command prompt and run the command iostat .

后续步骤Next steps

了解如何使用 Azure Monitor 进行监视。Learn how to monitor with Azure Monitor.