Performance tuning Xen



Similar documents
Full and Para Virtualization

Hardware Based Virtualization Technologies. Elsie Wahlig Platform Software Architect

Securing Your Cloud with Xen Project s Advanced Security Features

Cloud Computing CS

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

An Oracle Technical White Paper June Oracle VM Windows Paravirtual (PV) Drivers 2.0: New Features

Cloud^H^H^H^H^H Virtualization Technology. Andrew Jones May 2011

Virtualization for Cloud Computing

Date: December 2009 Version: 1.0. How Does Xen Work?

Chapter 14 Virtual Machines

Basics in Energy Information (& Communication) Systems Virtualization / Virtual Machines

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

Virtualization and Performance NSRC

2972 Linux Options and Best Practices for Scaleup Virtualization

Virtual Machines. COMP 3361: Operating Systems I Winter

Virtualization. Dr. Yingwu Zhu

COS 318: Operating Systems. Virtual Machine Monitors

Chapter 5 Cloud Resource Virtualization

Basics of Virtualisation

Virtualization. Types of Interfaces

Increasing XenServer s VM density

Xen and the Art of Virtualization

Xen and the Art of. Virtualization. Ian Pratt

CON9577 Performance Optimizations for Cloud Infrastructure as a Service

KVM: A Hypervisor for All Seasons. Avi Kivity avi@qumranet.com

Virtualization Performance on SGI UV 2000 using Red Hat Enterprise Linux 6.3 KVM

A quantitative comparison between xen and kvm

KVM KERNEL BASED VIRTUAL MACHINE

Virtual Machine Monitors. Dr. Marc E. Fiuczynski Research Scholar Princeton University

<Insert Picture Here> Oracle Database Support for Server Virtualization Updated December 7, 2009

GUEST OPERATING SYSTEM BASED PERFORMANCE COMPARISON OF VMWARE AND XEN HYPERVISOR

Architecture of the Kernel-based Virtual Machine (KVM)

kvm: Kernel-based Virtual Machine for Linux

Hypervisors. Introduction. Introduction. Introduction. Introduction. Introduction. Credits:

Virtualization benefits Introduction to XenSource How Xen is changing virtualization The Xen hypervisor architecture Xen paravirtualization

Intel s Virtualization Extensions (VT-x) So you want to build a hypervisor?

KVM Security Comparison

Virtualization Technology. Zhiming Shen

Virtual machines and operating systems

The Xen of Virtualization

Virtualizing a Virtual Machine

Introduction to Virtualization & KVM

How To Compare Performance Of A Router On A Hypervisor On A Linux Virtualbox 2.5 (Xen) To A Virtualbox (Xeen) Xen-Virtualization (X

Intro to Virtualization

Virtualization. Pradipta De

Enterprise-Class Virtualization with Open Source Technologies

Nested Virtualization

VMware and CPU Virtualization Technology. Jack Lo Sr. Director, R&D

Virtual Machines. Virtualization

Virtual Machines. Virtual Machine (VM) Examples of Virtual Systems. Types of Virtual Machine

Virtualizare sub Linux: avantaje si pericole. Dragos Manac

Virtualization. Jia Rao Assistant Professor in CS

Xen Project 4.4: Features and Futures. Russell Pavlicek Xen Project Evangelist Citrix Systems

Virtualization Technologies and Blackboard: The Future of Blackboard Software on Multi-Core Technologies

Models For Modeling and Measuring the Performance of a Xen Virtual Server

Enabling Technologies for Distributed Computing

Virtualization in Linux KVM + QEMU

RPM Brotherhood: KVM VIRTUALIZATION TECHNOLOGY

Practical Applications of Virtualization. Mike Phillips IAP 2008 SIPB IAP Series

Comparison of the Three CPU Schedulers in Xen

Nested Virtualization

Knut Omang Ifi/Oracle 19 Oct, 2015

Virtualization. Explain how today s virtualization movement is actually a reinvention

BHyVe. BSD Hypervisor. Neel Natu Peter Grehan

Scaling in a Hypervisor Environment

Parallels Virtuozzo Containers

SUSE Linux Enterprise 10 SP2: Virtualization Technology Support

Chapter 16: Virtual Machines. Operating System Concepts 9 th Edition

Distributed Systems. Virtualization. Paul Krzyzanowski

Understanding Full Virtualization, Paravirtualization, and Hardware Assist. Introduction...1 Overview of x86 Virtualization...2 CPU Virtualization...

OPEN SOURCE VIRTUALIZATION TRENDS. SYAMSUL ANUAR ABD NASIR Warix Technologies / Fedora Community Malaysia

Enabling Technologies for Distributed and Cloud Computing

MODULE 3 VIRTUALIZED DATA CENTER COMPUTE

PERFORMANCE ANALYSIS OF KERNEL-BASED VIRTUAL MACHINE

Bridging the Gap between Software and Hardware Techniques for I/O Virtualization

Virtualization Technologies

PROCESSOR VIRTUALIZATION ON EMBEDDED LINUX SYSTEMS

Cloud Operating Systems for Servers

CSE 501 Monday, September 09, 2013 Kevin Cleary

Monitoring Databases on VMware

Red Hat enterprise virtualization 3.0 feature comparison

Scheduling in The Age of Virtualization

Optimizing Network Virtualization in Xen

Hybrid Virtualization The Next Generation of XenLinux

Comparing Free Virtualization Products

Beyond the Hypervisor

Container-based operating system virtualization: a scalable, high-performance alternative to hypervisors

Virtualization and the U2 Databases

Using Linux as Hypervisor with KVM

RUNNING vtvax FOR WINDOWS

Regional SEE-GRID-SCI Training for Site Administrators Institute of Physics Belgrade March 5-6, 2009

nanohub.org An Overview of Virtualization Techniques

Virtualization: What does it mean for SAS? Karl Fisher and Clarke Thacher, SAS Institute Inc., Cary, NC

StACC: St Andrews Cloud Computing Co laboratory. A Performance Comparison of Clouds. Amazon EC2 and Ubuntu Enterprise Cloud

What is the difference between XenServer and the open-source Xen Project Hypervisor?

Virtualization System Vulnerability Discovery Framework. Speaker: Qinghao Tang Title:360 Marvel Team Leader

Best Practices for Monitoring Databases on VMware. Dean Richards Senior DBA, Confio Software

Optimizing Network Virtualization in Xen

Transcription:

Performance tuning Xen Roger Pau Monné roger.pau@citrix.com Madrid 8th of November, 2013

Xen Architecture Control Domain NetBSD or Linux device model (qemu) Hardware Drivers toolstack netback blkback Paravirtualized (PV) Domain: NetBSD or Linux netfront blkfront Fully Virtualized (HVM) Domain: Windows, FreeBSD... Xen Hypervisor I/O Devices CPU Memory Hardware Madrid 8th of November, 2013 Performance tuning Xen 2 / 27

Paravirtualization Virtualization technique developed in the late 90s Designed by: XenoServer research project at Cambridge University Intel Microsoft labs x86 instructions behave differently in kernel or user mode, options for virtualization were full software emulation or binary translation. Design a new interface for virtualization Allow guests to collaborate in virtualization Provide new interfaces for virtualized guests that allow to reduce the overhead of virtualization The result of this work is what we know today as paravirtualiztion Madrid 8th of November, 2013 Performance tuning Xen 3 / 27

Paravirtualization All this changes lead to the following interfaces being paravirtualized: Disk and network interfaces Interrupts and timers Boot directly in the mode the kernel wishes to run (32 or 64bits) Page tables Privileged instructions Madrid 8th of November, 2013 Performance tuning Xen 4 / 27

Full virtualization With the introduction of hardware virtualization extensions Xen is able to run unmodified guests This requires emulated devices, which are handled by Qemu Makes use of nested page tables when available. Allows to use PV interfaces if guest has support for them. Madrid 8th of November, 2013 Performance tuning Xen 5 / 27

The full virtualization spectrum VS VH PV Software virtualization Hardware virtualization Paravirtualized Poor performance Room for improvement Optimal performance Disk and network Interrupts and timers Emulated motherboard Privileged instructions and page tables HVM VS VS VS VH HVM with PV drivers PV VS VS VH PVHVM PV PV VS VH PV PV PV PV PV Madrid 8th of November, 2013 Performance tuning Xen 6 / 27

Guest support List of OSes and virtualization support: PV PVHVM HVM with PV drivers HVM Linux (PVOPS) YES YES YES YES Windows NO NO YES YES NetBSD YES NO NO YES FreeBSD NO YES YES YES OpenBSD NO NO NO YES DragonflyBSD NO NO NO YES Madrid 8th of November, 2013 Performance tuning Xen 7 / 27

Kernbench Kernbench 140 135 130 125 120 115 110 105 100 95 Results: percentage of native, the lower the better 90 PV on HVM 32 bit PV on HVM 64 bit HVM 64 bit HVM 32 bit PV 64 bit PV 32 bit Madrid 8th of November, 2013 Performance tuning Xen 8 / 27

Specjbb2005 SPECjbb2005 Results: percentage of native, the higher the better 100 90 80 70 60 50 40 30 20 10 0 PV 64 bit PV on HVM 64 bit Madrid 8th of November, 2013 Performance tuning Xen 9 / 27

Iperf Iperf tcp 8 Results: gbit/sec, the higher the better 7 6 5 4 3 2 1 0 PV 64 bit PV on HVM 64 bit PV on HVM 32 bit PV 32 bit HVM 64 bit HVM 32 bit Madrid 8th of November, 2013 Performance tuning Xen 10 / 27

What virtualization mode should I choose? Linux supports several virtualization modes, which one is better? Depends on the workload. Generally PV mode will provide better performance for IO, but when using 64bit guests PV can be slower. There isn t a fixed rule here, the best way to find out is to evaluate the workload on the different kind of guests. Madrid 8th of November, 2013 Performance tuning Xen 11 / 27

Dom0 Dom0 is the most important guest in the Xen infraestructure. It can become a bottleneck easily if not configured correctly. Dom0 is in charge of creating the guests, but usually also provides the backends and device models for guests. Xen provides some options to tune performance of Dom0 Madrid 8th of November, 2013 Performance tuning Xen 12 / 27

dom0 mem boot option dom0 mem tell Xen how much memory can be used by the Dom0. If not set all memory will be assigned to the Dom0, and ballooning will be used when launching new guests, reducing the memory used by the Dom0. The value should be set depending on the usage, HVM guests consume more memory in the Dom0 because they need a Qemu instance. If dom0 mem is set make sure to disable ballooning in the toolstack by setting autoballoon=0 in /etc/xen/xl.conf. Madrid 8th of November, 2013 Performance tuning Xen 13 / 27

dom0 max vcpus and dom0 vcpus pin dom0 max vcpus: maximum number of CPUs the Dom0 will see, also depends on the utilization of the Dom0 and the type of guests. dom0 vcpus pin: pinning Dom0 vcpus to physical CPUs is a good idea for systems running IO intensive guests. Setting up the serial cable: although not important for performance, setting up a serial cable is really important when debugging. For more info: http://wiki.xen.org/wiki/xen_serial_console Madrid 8th of November, 2013 Performance tuning Xen 14 / 27

Dom0 Boot tuning options For example if I had to set up a Dom0 on a machine with 8 CPUs and 8GB of RAM I would use the following boot line: com1=115200,8n1 console=com1 dom0 mem=1024m dom0 max vcpus=2 dom0 vcpus pin. More info about boot parameters can be found at: http://xenbits.xen.org/docs/unstable/misc/ xen-command-line.html. Madrid 8th of November, 2013 Performance tuning Xen 15 / 27

General performance notes Always try to use physical disks as backends. Xen has mainly two ways of connecting disks to the guest depending on the format of the image, if it s a block device it will be attached using blkback, which is inside the Linux kernel and it s faster. Take into account the number of CPUs your physical box has and avoid using more VCPUS than PCPUS if running performance intensive applications. Madrid 8th of November, 2013 Performance tuning Xen 16 / 27

Pinning CPUs You can pin VCPUs to PCPUs in order to obtain better performance or to distribute the workload across your CPUs to suit your needs. For example low latency VMs can be exclusively pinned to different PCPUs. cpus: allows to select in which CPUs the guest can run. The list can also contain specific CPUs where the guest is not allowed to run. Specifying 0-3,5,ˆ1 allows the guest to run on CPUs 0,2,3,5. If Dom0 is pinned to certain PCPUs avoid running guests on those PCPUs to obtain better performance. If Dom0 is pinned to CPU 0, use the following CPU mask in order to prevent other guests from running on CPU 0: ˆ0. Madrid 8th of November, 2013 Performance tuning Xen 17 / 27

Scheduler options The Xen scheduler has several options that can also be tunned from the guest configuration file, in order to give a certain guest more share from the processor or to schedule it more frequently. cpu weight: weight of the domain in terms of CPU utilization. For example a domain with a weight of 512 will get twice as much CPU than a domain with a weight of 256. Values range from 1 to 65535. cap: fixes the maximum amount of CPU a domain is able to consume. Expressed in percentage of one physical CPU. 100 is one CPU, 50 half a CPU, 400 four CPUs. More info can be found at http: //xenbits.xen.org/docs/unstable/man/xl.cfg.5.html Madrid 8th of November, 2013 Performance tuning Xen 18 / 27

Driver Domains I Control Domain NetBSD or Linux device model (qemu) Hardware Drivers toolstack netback blkback Paravirtualized (PV) Domain: NetBSD or Linux netfront blkfront Xen Hypervisor I/O Devices CPU Memory Hardware Madrid 8th of November, 2013 Performance tuning Xen 19 / 27

Driver Domains II Control Domain NetBSD or Linux device model (qemu) Hardware Drivers toolstack netback blkback Driver Domain netback blkback Paravirtualized (PV) Domain: NetBSD or Linux netfront blkfront Xen Hypervisor I/O Devices CPU Memory Hardware Madrid 8th of November, 2013 Performance tuning Xen 20 / 27

Driver Domains III Driver domains allow to offload work normally done in Dom0 to other domains. It also provides better security, less surface for exploits in Dom0. This is a current work-in-process. Madrid 8th of November, 2013 Performance tuning Xen 21 / 27

HVM specific I HVM guest require the usage of assisted paging, in order for the guest to see the memory area as contiguous when it s not. HAP: (Hardware Assisted Paging) is used by default since it tends to perform better under most workloads shadow: was introduced before HAP, and can provide better performance under certain workloads that have low TLB locality (for example databases or java applications). Again, the best way to know is to try the workload by yourself. Madrid 8th of November, 2013 Performance tuning Xen 22 / 27

HVM specific II HVM domains require a Qemu instance in Dom0 to perform the necessary device emulation. This might be a bottleneck if running a lot of HVM domains in the same node, since each one requires a Qemu instance running in Dom0 that uses both Dom0 CPU and Memory. To avoid this, we can launch the Qemu process in a different domain called Stubdomain. This allows to offload work from Dom0. Madrid 8th of November, 2013 Performance tuning Xen 23 / 27

HVM specific III Control Domain NetBSD or Linux Hardware Drivers device model (qemu) toolstack netback blkback Fully Virtualized (HVM) Domain: Windows, FreeBSD... Xen Hypervisor I/O Devices CPU Memory Hardware Madrid 8th of November, 2013 Performance tuning Xen 24 / 27

HVM specific IV Control Domain NetBSD or Linux Hardware Drivers device model (qemu) toolstack netback blkback stubdomain MiniOS Qemu Fully Virtualized (HVM) Domain: Windows, FreeBSD... Xen Hypervisor I/O Devices CPU Memory Hardware Madrid 8th of November, 2013 Performance tuning Xen 25 / 27

Conclusions Xen offers a wide variety of virtualization modes. The best way to know which mode will bring better performance is to try it, although there are several tips that apply to all guests. We are constantly working on performance improvements, so keep updated in order to get the best performance. Madrid 8th of November, 2013 Performance tuning Xen 26 / 27

Q&A Thanks Questions? http://wiki.xen.org/wiki/xen_best_practices http://wiki.xen.org/wiki/xen_common_problems Madrid 8th of November, 2013 Performance tuning Xen 27 / 27