Performance Profiling in a Virtualized Environment

1,485 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,485
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
12
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Performance Profiling in a Virtualized Environment

  1. 1. Performance Profiling in a Virtualized EnvironmentJiaqing Du+, Nipun Sehrawat*, Willy Zwaenepoel++EPFL, Switzerland*IIT Guwahati, India
  2. 2. Virtualization-based Clouds• Diverse implementations – software: Xen, KVM, VMware, … – hardware: Intel x86, AMD x86, PowerPC, …• Opportunities for performance profiling & tuning – public cloud: guest OS & applications – private cloud: whole software stack Profilers based on CPU performance counters do not work well with virtual machines.Jiaqing Du, HotCloud, June 22, 2010 2
  3. 3. Profiling in a Virtualized Environment• General challenge• XenOProf: profiling in the VMM – only for paravirtualization-based Xen – require accesses to the VMM• Profiling in the guest – normally no results – “OProfile cant work with VMware when using performance counter interface. ”Jiaqing Du, HotCloud, June 22, 2010 3
  4. 4. Performance Profiling• Understand runtime behavior• Tune performance• Mature & used extensively – VTune, OProfile, … %CYCLE Function Module 98.5529 vmx_vcpu_run kvm-intel.ko 0.2226 (no symbols) libc.so 0.1034 hpet_cpuhp_notify vmlinux 0.1034 native_patch vmlinuxJiaqing Du, HotCloud, June 22, 2010 4
  5. 5. Native Profiling• Performance monitoring unit (PMU) – a set of event counters – generate an interrupt when a counter overflows• PMU-based profiler User control process – sampling configuration Kernel – sample collection Module Interpret* – sample interpretation Configure Collect CPU PMUJiaqing Du, HotCloud, June 22, 2010 5
  6. 6. Guest-wide Profiling• Expose PMU interfaces to the guest User control process Kernel Module Interpret* Configure Collect VMM CPU PMUJiaqing Du, HotCloud, June 22, 2010 6
  7. 7. Guest-wide Profiling• Where to save & restore the registers?• CPU switch – only in-guest execution is accounted to the guest guest1 VMM guest2 VMM guest2 save&restore• Domain switch – in-VMM execution is also accounted to the guest guest1 VMM guest2 VMM guest2 domain1 domain2 save&restoreJiaqing Du, HotCloud, June 22, 2010 7
  8. 8. Guest-wide Profiling for KVM• Kernel-based virtual machine (KVM) – a Linux kernel subsystem – a set of kernel modules + QEMU – built on hardware virtualization extensions• Intel VT extensions – provide a list of hardware features – facilitate our implementation• No modifications to the guest and the profilerJiaqing Du, HotCloud, June 22, 2010 8
  9. 9. Profiling Packet Receive• Experiment – push packets to a Linux guest in KVM – run OProfile in the guest – monitor instruction retirements Linux KVM virtual NIC Linux Hardware Hardware NIC NICJiaqing Du, HotCloud, June 22, 2010 9
  10. 10. Profiling Packet Receive CPU Switch Domain Switch INSTR Function INSTR Function 167 csum_partial 2261 cp_interrupt 106 csum_partial_copy_generic 1336 cp_rx_poll 74 copy_to_user 1034 cp_start_xmit 47 ipt_do_table 421 native_apic_mem_write 38 tcp_v4_rcv 374 native_apic_mem_read … … 191 csum_partial 19 cp_rx_poll 105 csum_partial_copy_generic 6 cp_start_xmit 94 copy_to_user 6 cp_interrupt 79 ipt_do_table 3 native_apic_mem_write 51 tcp_v4_rcv 1184 counter overflows 7286 counter overflowsJiaqing Du, HotCloud, June 22, 2010 10
  11. 11. Other Things in the Paper• System-wide profiling – profiling in the VMM – provide full-scale view: guest + VMM• Virtualization techniques – paravirtualization – dynamic binary translationJiaqing Du, HotCloud, June 22, 2010 11
  12. 12. Conclusions• Profilers do not work well with virtual machines.• We implement guest-wide profiling in a VMM based on hardware assistance.• Profiling helps understand the real cost of I/O operations in a guest.Jiaqing Du, HotCloud, June 22, 2010 12

×