• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Kvm optimizations
 

Kvm optimizations

on

  • 1,694 views

 

Statistics

Views

Total Views
1,694
Views on SlideShare
1,693
Embed Views
1

Actions

Likes
4
Downloads
29
Comments
0

1 Embed 1

https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Kvm optimizations Kvm optimizations Presentation Transcript

    • CentOS Dojo 2013KVM Optimizations and Best Practices From the Desktop to the Datacenter Jaime Melis (opennebula.org)
    • Summary● Tools● Drivers● Image Backends● CPU● Memory● Networking● Desktop Sharing● Cloud point-of-view Challenges
    • Tools● Libvirtd !!!!!!● virt-manager● virt-install● qemu-img● virt-alignment-scan (libguestfs)● lstopo● OpenNebula
    • Drivers● Easy... use virtio!!!● Huge performance gain● No emulation● Cooperation with the hypervisor● Integrated into the linux kernel
    • Image Backends● Regular file● Qcow2 – snapshots (beware of the sync!) – additonal layer, less performance – compressed● LVM → block device (san storage)● Virt-alignment-scan● Cache – Writethrough (host page on, guest disk write cache off) – Writeback (host page on, guest disk write cache on) ● Good overall I/O Performance – None (host page off, guest disk write cache on) ● Good write performance
    • CPU - pinning● NUMA (Non-Uniform Memory Access)● Shared cache ~ 15% improvement● Bad for different tasks● Processor availability● virsh capabilities● lstopo
    • CPU - pinning<cputune> <vcpupin vcpu="0" cpuset="1-4,^2"/> <vcpupin vcpu="1" cpuset="0,1"/> <vcpupin vcpu="2" cpuset="2,3"/> <vcpupin vcpu="3" cpuset="0,4"/> ...</cputune>
    • CPU - cgroups● Limit, account and● Bad for different tasks● Processor availability● virsh capabilities● lstopo
    • CPU - cgroups● Limit, account and isolate resource usage <cputune> <shares>2048</shares> ... </cputune>
    • CPU - model● Subset of features● Increase performance● Nested virtualization● /usr/share/libvirt/cpu_map.xml <cpu match=exact> <model fallback=allow>core2duo</model> <vendor>Intel</vendor> <topology sockets=1 cores=2 threads=1/> <feature policy=disable name=lahf_lm/> </cpu>
    • Memory - KSM● Kernel Samepage Merging● Combines memory private pages● Very useful for VMs !!!!● Increases VM density● Enable by default
    • Networking7● MacVTap (direct)... NO!● Bridged networking... way to go!● Disable STP● Optimal configuration● NAT (masquerading)● iptables
    • Desktop Sharing● VNC● SPICE – qlx driver – Redirect printers – Usb (mass-storage) – Audio
    • Cloud Challenges● Virt-manager + LVM + DHCP => 10 hosts● Live-migration to any host● Image layout – dont waste space● Contextualization: install once and deploy many● Network Isolation● Mac/IP spoofing● Multi-tenancy
    • Cloud Challenges - ebtables● Isolate● Prevent mac spoofing # Drop packets that dont match the networks MAC Address -s ! <mac_address>/ff:ff:ff:ff:ff:0 -o <tap_device> -j DROP # Prevent MAC spoofing -s ! <mac_address> -i <tap_device> -j DROP
    • Cloud Challenges – What storage?● No Storage Holy Grail LVM2 iSCSI Qcow2 + DFS Provisioning time + ++ +++ I/O ++ ++ + Network ++ +++ + Snapshotting - - + Livemigration + - +
    • Thanks for attending!jmelis - #opennebula @Freenode