cloud operating systems for servers · cloud operating systems for servers ... 4 most cloud...

21
© 2014 IBM Corporation Cloud Operating Systems for Servers Mike Day Distinguished Engineer, Virtualization and Linux August 20, 2014 [email protected] 1

Upload: dangtu

Post on 06-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

© 2014 IBM Corporation

Cloud Operating Systems for Servers Mike Day Distinguished Engineer, Virtualization and LinuxAugust 20, 2014

[email protected]

Page 2: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

2 © 2014 IBM Corporation

!Consumes Few Resources ! Fast Booting time !Provides Containers or Virtual Machines !Automatically Deployed and Updated !Updates are Atomic !Runs Workloads with Excellent Performance !Good Networking and Storage Support – Provides network and block storage to containers or virtual

machines

What Makes a Good Cloud Operating System?

Page 3: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

3 © 2014 IBM Corporation

Most Cloud Operating Systems are Based Upon Linux

!Kernel Configuration Enables Build of Tiny Kernels

Page 4: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

4

Most Cloud Operating Systems are Based Upon Linux (cont’d.)

! Kernel Configuration Enables Tiny Kernels ! GPL Enables Source Modification ! Linux Enjoys a Heritage of Embedded Systems – Embedded Systems share many requirements with Cloud Operating

Systems ! Choice of Network File Systems and Block Services ! Up-to-Date Networking and Storage Support

Page 5: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

5 © 2014 IBM Corporation

Innovation in Cloud Operating Systems

!Single-purpose Host OS - designed to Run Multiple Instances of a Different Guest OS !Perhaps Using the Same Kernel, Perhaps Not

!Clustered and Distributed Host OS and toolkit

9

Page 6: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

6 © 2014 IBM Corporation

Innovation in Cloud Operating Systems, cont’d.

!Host Designed to Migrate Workloads !Atomic Updates of Host OS !Use of Non-Traditional Systems Languages !C++, golang !Unusual Performance Techniques !Single Memory Space ! Abnormally High use of Lock-Free Algorithms and Structures !Collaborative Memory Management ! Tickless Operation

9

Page 7: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

7 © 2014 IBM Corporation

Primary Techniques Used by Cloud Operating Systems to Reduce Overhead

! Shared Host Kernel ! Linux Containers - Each Workload Shares the Host Kernel

!

! Tiny, Super-tuned Guest Kernel ! Running in a Virtual Machine ! OSv - lockless, single memory space, paravirtual

I/O, Cooperative Memory Management etc.

9

Page 8: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

8

A Survey of Cloud Operating Systems

! CoreOS “Linux for Massive Server Deployments”

! https://coreos.com

! Project Atomic “Deploy and Manage your Docker Containers”

! http://www.projectatomic.io ! OSV “Probably the Best OS for Cloud Workloads” ! http://osv.io

Page 9: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

9 © 2014 IBM Corporation

OSv

! http://osv.io – Specialty Operating System Designed to Run Efficiently in a Virtual

Machine – Single process group, Single Memory space – Built-in VM for running Java and other languages with same byte

codes – clib, POSIX environment – virtio drivers, netchannels – Implemented largely in c++ – Significant re-use of freebsd

– XFS, networking stack

Page 10: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

10 © 2014 IBM Corporation

OSv Attacks on Overhead and Jitter

! OSv Attacks on Performance Overhead: – Avoids resource starvation through a very small kernel, single flat memory

space – Reduces Exits on faults through a single process group and single memory

space – No need to translate between user-space and kernel-space addresses.

! OSv Attacks on Jitter: – JVM collaborates with hypervisor, has intelligent garbage collection – net channels moves protocol processing out of interrupt handler – Single-process execution environment reduces synchronization issues

– Lock-free algorithms, RCU – Tickless Scheduler

Page 11: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

11 © 2014 IBM Corporation

Docker

! http://www.docker.com – Distributed runtime (with REST API) for deploying Linux Containers (LXC). – Docker is really about containers (for now)

– Docker package format and online repositories provide the real value. – Linux Containers virtualize the host kernel – Thinner virtualization than hypervisors, completely integrated with Linux – Docker Container inherits the performance and jitter characteristics of the

host kernel

Page 12: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

12 © 2014 IBM Corporation

Docker Attacks on Overhead and Jitter

! Docker Attacks on Performance Overhead: – With Docker containers, no additional resource translation beyond kernel and

user spaces. – Containers may use physical I/O devices; in which case we don’t need

interrupt virtualization – Uses less memory than most hypervisors

! Docker Attacks on Jitter: – Does not need to virtualize timer, other interrupts – More predictable scheduling model (one kernel scheduler - not two)

– Holds true for I/O schedulers as well

Page 13: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

13 © 2014 IBM Corporation

CoreOS

! Small Linux Kernel

! Linux Containers

! Docker

! etcd - Distributed Dictionary - Provides Service Discovery, events and Configuration

! Atomic updates to Host OS through active/passive Partition Scheme

! fleet Clustering - Run Container Workloads Throughout the Cluster

Page 14: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

14 © 2014 IBM Corporation

Project Atomic

! Small Linux Kernel

! Linux Containers

! Docker

! Atomic Updates with rpm-ostree

! etcd - distributed dictionary also used in CoreOS

! Anaconda Installer

Page 15: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

15

Cloud OS Performance

! We Can Review Two Different Comparisons

! Linux Containers versus KVM Virtual Machines

! OSv Guest versus Linux Guest

Page 16: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

16

LXC Versus KVM Virtual Machines

! Roughly Equal: ! Memory Bandwidth

! TCP Throughput

! Sequential Block IO

! NoSQL Deployment Scenario

! Containers Exceed VMs: ! TCP Latency

! Random Block IO and latency*

! MySQL Throughput** http://goo.gl/ZQFCL6 https://github.com/thewmf/kvm-docker-comparison

* Authors Failed to use a key I/O Optimization, and used a sub-optimal virtual disk configuration. They should have passed through block partitions and enabled host caching.!

** Authors used a sub-optimal virtual disk configuration. They should have passed through block partitions.

Page 17: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

OSv Evaluation

● Compared OSv guest to Fedora 20 guest w/o firewall. ● On KVM host.

!

● https://www.usenix.org/system/files/conference/atc14/atc14-paper-kivity.pdf

17

Page 18: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

Macro benchmarks

● Memcached. UDP. Single-vCPU guest, loaded with memaslap (90% get, 10% set) − OSv throughput 22% better than Linux.

● Memcached reimplemented with packet-filtering API − OSv throughput 290% better than baseline.

● SPECjvm2008. Suite of CPU/memory intensive Java workloads. Little use of OS services. − Can't expect much improvement. Got 0.5%. − Good correctness test (diverse, checks results).

18

Page 19: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

OSv Micro benchmarks

● Netperf – measure network stack performance. − TCP single-stream thoughput: 24% improvement. − UDP and TCP r/r latency: 37%-47% reduction.

● Context switch - two threads, alternate waking each other with pthreads condition variable. − 3-10 times faster than in Linux. − As little as 328 ns when two threads on same CPU.

● JVM Balloon – microbenchmark where large heap and large page cache are needed, but not at the same time. − Osv 35% faster than Linux.

19

Page 20: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

OSv Latest unofficial results

● Experimental, non-release, code... ● Need more verification... − Cassandra stress test, READ, 4 vcpu, 4 GB ram

● OSv 34% better − Tomcat, servlet sending fixed response, 128 concurrent HTTP connections,

measure throughput. 4 vcpus, 3GB ● OSv 41% better.

20

Page 21: Cloud Operating Systems for Servers · Cloud Operating Systems for Servers ... 4 Most Cloud Operating Systems are Based Upon ... – Single-process execution environment reduces synchronization

21 © 2014 IBM Corporation

www.ibm.com/systems/kvm

[email protected]