Linux Virtual Machine Performance monitoring

Source: Internet
Author: User
Tags passthrough

Performance monitoring Tools

Perf KVM

In order to use Perf KVM in the host, you must access/Proc/modules and
/proc/kallsyms file. "Copy/proc files from guest virtual machine to host" to transfer files to the host and run reports on the files.

Attention:

If you copy the required files directly (for example, using SCP), you will only copy the zero file
Length. This procedure describes how to first save the files in the guest virtual machine to a temporary location
(using the Cat command), and then copy them to the host for use by perf KVM.

Execute on the guest system:

# cat/proc/modules >/tmp/modules

# cat/proc/kallsyms >/tmp/kallsyms

# SCP [Email protected]:/tmp/kallsyms guest-kallsyms

# SCP [Email protected]:/tmp/modules guest-modules

You now have two files from guest (guest-kallsyms and Guest-modules), ready to be used by perf KVM.

Execute in Host:

# perf KVM--host--guest--guestkallsyms=guest-kallsyms \--guestmodules=guest-modules record-a-o perf.data

Perf--host and--guest are used in commands, the output will be stored
PERF.DATA.KVM. If you use only--host, the file is named Perf.data.host.
Similarly, if you use only--guest, the file will be named Perf.data.guest.

Reporting events
The following example command uses the files obtained through the logging process, and
Redirect the output to a new file for analysis.

Perf KVM--host--guest--guestmodules=guest-modules report-i PERF.DATA.KVM \--force > Analyze

View the contents of the analysis file to examine the logged events:

Cat Analyze

Virtual Performance Monitoring Unit (PMU)

Virtual Performance Monitoring Unit (VPMU) Displays statistics that indicate how a guest virtual machine is
The machine runs.
Virtual performance Monitoring Unit allows users to identify sources of possible performance
Problems in the guest virtual machine. VPMU based on Intel's PMU (performance monitoring)
Unit), and can only be used on Intel machines.
This feature is supported only for customer virtual machines running Red Hat Enterprise Linux 6 or red
Hat Enterprise Linux 7, and is disabled by default.
To verify that your system supports VPMU, check the ARCH_PERFMON flag on the host CPU
By running:

# Cat/proc/cpuinfo|grep Arch_perfmon

To enable VPMU, specify the CPU mode as Host-passthrough in the guest virtual machine xml:

# Virsh Dumpxml guest_name |grep "CPU Mode"

<cpu mode= ' Host-passthrough ' >

When VPMU is enabled, performance statistics for virtual machines are displayed by running perf in the virtual machine

Linux Virtual Machine Performance monitoring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.