Performance Profiling in a Virtualized Environment Jiaqing Du + , - - PowerPoint PPT Presentation

performance profiling in a virtualized environment
SMART_READER_LITE
LIVE PREVIEW

Performance Profiling in a Virtualized Environment Jiaqing Du + , - - PowerPoint PPT Presentation

Performance Profiling in a Virtualized Environment Jiaqing Du + , Nipun Sehrawat * , Willy Zwaenepoel + + EPFL, Switzerland * IIT Guwaha9, India Virtualiza9onbased Clouds Diverse implementa9ons soDware: Xen, KVM, VMware,


slide-1
SLIDE 1

Performance Profiling in a Virtualized Environment

Jiaqing Du+, Nipun Sehrawat*, Willy Zwaenepoel+

+EPFL, Switzerland *IIT Guwaha9, India

slide-2
SLIDE 2

Virtualiza9on‐based Clouds

  • Diverse implementa9ons

– soDware: Xen, KVM, VMware, … – hardware: Intel x86, AMD x86, PowerPC, …

  • Opportuni9es for performance profiling & tuning

– public cloud: guest OS & applica9ons – private cloud: whole soDware stack

Jiaqing Du, HotCloud, June 22, 2010 2

Profilers based on CPU performance counters do not work well with virtual machines.

slide-3
SLIDE 3

Profiling in a Virtualized Environment

  • General challenge
  • XenOProf: profiling in the VMM

– only for paravirtualiza9on‐based Xen – require accesses to the VMM

  • Profiling in the guest

– normally no results – “OProfile can't work with VMware when using performance counter interface. ”

Jiaqing Du, HotCloud, June 22, 2010 3

slide-4
SLIDE 4

Performance Profiling

  • Understand run9me behavior
  • Tune performance
  • Mature & used extensively

– VTune, OProfile, …

Jiaqing Du, HotCloud, June 22, 2010 4

%CYCLE FuncCon Module 98.5529 vmx_vcpu_run kvm‐intel.ko 0.2226 (no symbols) libc.so 0.1034 hpet_cpuhp_no9fy vmlinux 0.1034 na9ve_patch vmlinux

slide-5
SLIDE 5

Na9ve Profiling

  • Performance monitoring unit (PMU)

– a set of event counters – generate an interrupt when a counter overflows

  • PMU‐based profiler

– sampling configura9on – sample collec9on – sample interpreta9on

Jiaqing Du, HotCloud, June 22, 2010 5

PMU CPU Kernel User control process Module Collect Configure Interpret*

slide-6
SLIDE 6

Guest‐wide Profiling

Jiaqing Du, HotCloud, June 22, 2010 6

PMU CPU Kernel User control process Module Collect Configure Interpret* VMM

  • Expose PMU interfaces to the guest
slide-7
SLIDE 7

Guest‐wide Profiling

  • Where to save & restore the registers?
  • CPU switch

– only in‐guest execu9on is accounted to the guest

  • Domain switch

– in‐VMM execu9on is also accounted to the guest

Jiaqing Du, HotCloud, June 22, 2010 7

VMM guest1 guest2 VMM guest2

save&restore

VMM guest1 guest2 VMM guest2

save&restore domain1 domain2

slide-8
SLIDE 8

Guest‐wide Profiling for KVM

  • Kernel‐based virtual machine (KVM)

– a Linux kernel subsystem – a set of kernel modules + QEMU – built on hardware virtualiza9on extensions

  • Intel VT extensions

– provide a list of hardware features – facilitate our implementa9on

  • No modifica9ons to the guest and the profiler

Jiaqing Du, HotCloud, June 22, 2010 8

slide-9
SLIDE 9

Profiling Packet Receive

  • Experiment

– push packets to a Linux guest in KVM – run OProfile in the guest – monitor instruc9on re9rements

Jiaqing Du, HotCloud, June 22, 2010 9

Linux

NIC

Hardware KVM

virtual NIC NIC

Hardware Linux

slide-10
SLIDE 10

… … 19 cp_rx_poll 6 cp_start_xmit 6 cp_interrupt 3 na9ve_apic_mem_write

Profiling Packet Receive

Jiaqing Du, HotCloud, June 22, 2010 10

INSTR FuncCon 167 csum_par9al 106 csum_par9al_copy_generic 74 copy_to_user 47 ipt_do_table 38 tcp_v4_rcv INSTR FuncCon 2261 cp_interrupt 1336 cp_rx_poll 1034 cp_start_xmit 421 na9ve_apic_mem_write 374 na9ve_apic_mem_read

CPU Switch Domain Switch

191 csum_par9al 105 csum_par9al_copy_generic 94 copy_to_user 79 ipt_do_table 51 tcp_v4_rcv

1184 counter overflows 7286 counter overflows

slide-11
SLIDE 11

Other Things in the Paper

  • System‐wide profiling

– profiling in the VMM – provide full‐scale view: guest + VMM

  • Virtualiza9on techniques

– paravirtualiza9on – dynamic binary transla9on

Jiaqing Du, HotCloud, June 22, 2010 11

slide-12
SLIDE 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 opera9ons

in a guest.

Jiaqing Du, HotCloud, June 22, 2010 12