首页 文章

QEMU-KVM性能优化

提问于
浏览
-1

我正在尝试测试QEMU-KVM和主机之间的性能差异,并且无法理解如何优化我的QEMU-KVM以实现接近本机性能 .

我使用lubuntu 14.04安装了QEMU-KVM,并运行了一个不会产生任何缓存未命中的压力微基准测试 .

我正在录制性能计数器,退出指令,使用perf监控工具 .

由于QEMU没有提供此性能计数器 . 我正在使用来自主机系统的perf记录整个QEMU过程的性能 .

获得的结果并未反映出这一点 . 我不确定如何设置QEMU-KVM子系统 .

我将在下面描述QEMU和主机(裸机)的细节 .

QEMU仿真器版本2.0.0与KVM一起作为虚拟环境和libvirt 1.2.2

来宾计算机正在运行内核版本 3.19.0-15-generic ,主机正在x86_64计算机上运行 3.14.5-031405-generic 版本

guest machine with Intel SandyBridge processor (model name:Intel Xeon E312xx) with the following flags: sockets=1,cores=1,threads=1 and 4mb cache.
More details:
cpu family    : 6
model        : 42
max freq        : 2394.560 MHz
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm vnmi ept xsaveopt


The host machine is an Intel Sandy Bridge processor (Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz) with 4 cores and 6mb cache.
cpu family    : 6
model        : 42
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid

如果我能提供更多细节,请告诉我 .

谢谢!

1 回答

  • 0

    尝试使用事件修饰符,如“perf help list”中所述:

    EVENT MODIFIERS
           Events can optionally have a modifer by appending a colon and one or more
           modifiers. Modifiers allow the user to restrict the events to be counted. The
           following modifiers exist:
    
               u - user-space counting
               k - kernel counting
               h - hypervisor counting
               G - guest counting (in KVM guests)
               H - host counting (not in KVM guests)
               p - precise level
               S - read sample value (PERF_SAMPLE_READ)
               D - pin the event to the PMU
    

    上面的文档不能令人满意恕我直言,我不完全理解每个事件修饰符的含义 . 有时我会得到不一致的结果,例如用户空间计数(“u”修饰符)中的退休指令多于完全计数(根本没有修饰符) .

    我正在使用以下perf版本:

    >> perf --version
    perf version 3.13.11-ckt20
    

相关问题