aptira presents openstack nova and kvm optimisation

11
APTIRA PRESENTS – OPENSTACK NOVA AND KVM OPTIMISATION Kavit Munshi, CTO, Aptira - @KavitAptira, [email protected]

Upload: aptira

Post on 15-Jan-2015

605 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Aptira presents OpenStack nova and kvm optimisation

APTIRA PRESENTS – OPENSTACK NOVA AND KVM OPTIMISATIONKavit Munshi, CTO, Aptira - @KavitAptira, [email protected]

Page 2: Aptira presents OpenStack nova and kvm optimisation

OPENSTACK NOVA

Nova is the project name for OpenStack Compute, a cloud computing fabric controller, the main part of an IaaS system. Individuals and organizations can use Nova to host and manage their own cloud computing systems.

Key components of the compute part of OpenStack are

• Nova• Cinder• Glance

These are also the weakest points of an OpenStack deployment and suffer the most from performance hits.

Page 3: Aptira presents OpenStack nova and kvm optimisation

COMPUTE PERFORMANCE BOTTLENECKS

Compute nodes run the actual virtual instances that power an IaaS solution. These run Hypervisors to share resources between the instances. The performance of the hypervisor can be affected by.

• I/O : All instances use local file system to host filesystems. Scarce resources as more instances are run per server by increasing cores. First to be hit.

• Memory/RAM: Second factor to be hit after disks. Most VMs use RAM more extensively than CPU. With increasing cores and larger VMs RAM contention becomes a problem

• CPU: Usually the last to be hit. Not as much of a problem any more because of Hyper threading and multiple cores.

Page 4: Aptira presents OpenStack nova and kvm optimisation

NOVA CONFIGURATION TO AVOID BOTTLENECKS

Admins can take several precautions in the way Nova is configured to ensure optimal performance of the hypervisor

• Flavours: Only allow sensible flavours for the users. Example on a compute node with 8 CPU cores and 96 GB ram avoid creating a flavour that uses 1 vCPU and 64 GB RAM

• Quotas: Used to limit the number of resources used by a particular tenant: number of instances, block volume number and space, or number of snaphsots and images kept in Glance. Consider the potential number of tenants and available hardware.

• Overprovisioning: Use technologies like thin provisioning, hyper threading to over provision resources but have to be careful about performance hits.

Page 5: Aptira presents OpenStack nova and kvm optimisation

CHOICE OF HYPERVISOR

Many kinds of hypervisors are supported by Nova. The most popular ones are:

• KVM• Xen• Hyper-V• VMWare ESXi

For the purpose of this talk we are going to assume that we will be using KVM. It is the most popular and the best supported hypervisor on Nova.

KVM has also have a great improvement in performance in the recent times.KVM is also best suited to run Linux machines.

Page 6: Aptira presents OpenStack nova and kvm optimisation

List of KVM settings that can improve guest performance:

• Kernel I/O scheduler to “Deadline”. Default is cfq, good enough for most work loads but for over povisioning use “deadline”

• Huge pages enabled• Kernel same-page merging enabled (KSM)• Hyper threading turned on• Place guest file systems directly on hypervisor block devices instead of in files.

OPTIMISING KVM

For optimising running instances use the following drivers• Virtio_net (Network driver)• Virtio_blk (block device driver)

Page 7: Aptira presents OpenStack nova and kvm optimisation

PERFORMANCE IMPROVEMENT WITH DEADLINE SCHEDULER

Page 8: Aptira presents OpenStack nova and kvm optimisation

HUGE PAGES

A page, memory page, or virtual page is a fixed-length contiguous block of virtual memory, and it is the smallest unit of data for the following:• memory allocation performed by the operating system for a program; and• transfer between main memory and any other auxiliary store, such as a hard

disk drive.

On x86_64 architecture standard page size is 4kb. A huge page is 4MB and a large page is 1 GB.

There are couple of important benefits of HugePages:• Page size is set 2MB instead of 4KB• Memory used by HugePages is locked and cannot be swapped.

Huge Pages can also be enabled INSIDE running instances for best performance.

Page 9: Aptira presents OpenStack nova and kvm optimisation

KERNEL SAME-PAGE MERGING

KSM lets the hypervisor system share identical memory pages amongst different processes or virtualized guests.

The ksmtuned process work in the following way:

• scans through the memory finding duplicate pages• Merges duplicate page to single page• Map to all virtual machine locations• Set copy on write• Separate page when individual guests write to it.

KSM is critical to performance if you want to over provision your resources successfully.

Page 10: Aptira presents OpenStack nova and kvm optimisation

SOURCES

This presentation was created from the following sources. Please read them to better understand the concepts

http://www.linux-kvm.org/wiki/images/5/59/Kvm-forum-2011-performance-improvements-optimizations-D.pdf

http://www.mirantis.com/blog/making-most-of-openstack-compute-performance/

http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=%2Fliaat%2Fliaatbpperfmods.htm

http://www.linux-kvm.com/content/using-ksm-kernel-samepage-merging-kvm

http://www.pythian.com/news/1326/performance-tuning-hugepages-in-linux/

http://www.linux-kvm.org/wiki/images/9/9e/2010-forum-thp.pdf

Page 11: Aptira presents OpenStack nova and kvm optimisation

THE END

Questions?

How to find us

http://aptira.comFollow @[email protected]@KavitAptira