Slide 1

Slide 1 text

OSv Designed for the cloud Pekka Enberg @penberg Tzach Livyatan @TzachL Cloudius Systems FOSDEM 2014

Slide 2

Slide 2 text

About Cloudius ● Founded in December 2012 ● ~14 people ● 7 countries ● Open source experience ● Linux Foundation member

Slide 3

Slide 3 text

Mission ● Be the best OS powering VMs in the cloud.

Slide 4

Slide 4 text

What is OSv?

Slide 5

Slide 5 text

OSv ● “Cloud OS” written from scratch ● C++11 ● BSD licensed ● Networking stack and ZFS imported from FreeBSD ○ We are modifying the networking stack ○ Switching to OpenZFS in the future

Slide 6

Slide 6 text

Why a new operating system?

Slide 7

Slide 7 text

Typical Cloud Stack Application Application Server JVM Operating System Hypervisor Hardware Protection and abstraction

Slide 8

Slide 8 text

● Single application per VM ● No kernel and userspace separation ● No fork() ● MMU access via OSv APIs ● POSIX APIs for compatibility “Library OS”

Slide 9

Slide 9 text

“Library OS” Application Application Server JVM + OSv Hypervisor Hardware

Slide 10

Slide 10 text

Features

Slide 11

Slide 11 text

OS Services ● Scheduler ● Memory management ○ mmap ○ demand paging ● Networking ● File system ○ ZFS and ramfs

Slide 12

Slide 12 text

● Linux system calls ○ uname() reports Linux for compatibility ● libc ● OSv APIs APIs

Slide 13

Slide 13 text

● Pure 64-bit OS ● 64-bit x86 ○ KVM ○ Xen HVM ○ Xen PV - incomplete ○ VMware and VirtualBox - in progress ● 64-bit ARM - planned ● Others - help wanted! Architectures

Slide 14

Slide 14 text

Status ● JVM languages ○ Java, JRuby, Scala, Groovy, Clojure, JavaScript ● JVM applications ○ Cassandra ○ Tomcat ● Other runtimes ○ mruby ○ I would love to see someone port Node.js... ● Native applications ○ memcached ○ haproxy

Slide 15

Slide 15 text

Demo

Slide 16

Slide 16 text

Performance

Slide 17

Slide 17 text

Performance ● Outperforms Linux ○ SpecJVM, memcached, netperf ● Same as Linux ○ Tomcat ○ Cassandra ● < 1 second boot time ● 4x faster context switch in scheduler microbenchmarks than Linux

Slide 18

Slide 18 text

Image Size ● 17 MB minimal image ○ kernel + libc ● 29 MB mruby image ○ kernel + libc + mruby ● 465 MB default image (!) ○ kernel + libc + openjdk ○ openjdk is 127 MB ○ ZFS intent log related, working on a fix

Slide 19

Slide 19 text

How is OSv different?

Slide 20

Slide 20 text

● Linux network channels by Van Jacobson ○ Proposed in 2006, never merged ○ Packet processing overhead reduced by 25% for 1 CPU and 20% for 2 CPUs (source: lwn.net) ● Network channels in OSv ○ Channel connected to the application ● Netperf throughput increases 30% from ~36 Gbps to ~47 Gbps ○ Linux on host, OSv in guest Network channels

Slide 21

Slide 21 text

JVM Balloon ● GC heap autotuning ● Steal memory from JVM on OS memory pressure ● Running on unmodified JVM ○ Compacting GC causes interesting problems ● Nice presentation by Glauber Costa on Youtube

Slide 22

Slide 22 text

● Replace GC card tables with MMU remapping ● Modified OpenJDK ● Azul C4’s GC uses similar MMU tricks on x86 ○ Out-of-tree Linux patches JVM and MMU

Slide 23

Slide 23 text

Admin

Slide 24

Slide 24 text

OS Admin Traditional OS ● Built for a standalone desktop ● CLI oriented ● Human oriented ● File base configuration ● Hard to automate Cloud OS ● Built for mass deployment ● API oriented ● Machine oriented ● API base configuration ● Easy to automate

Slide 25

Slide 25 text

Admin as collection of services OSv OSv OSv OSv Operation Configuration Packaging OSv Trace / Log Binary REST Metering Centralize Administration

Slide 26

Slide 26 text

Operation Service Base on REST API (GET, POST, …) Successful Sync operations - 200 Successful A-sync operation - 202 A-sync operation result available in log with correlation id REST API definition use Swagger OSv OSv OSv Operations OSv

Slide 27

Slide 27 text

Configuration Service Level of configuration: 1. Image configuration: capture as part of the image. 2. Init configuration: update at init phase (as in cloud-init) 3. Runtime configuration: instance lifetime No configuration overriding Same API for all configuration levels API is the only way to access configuration Configuration is ordered in a tree structure OSv OSv OSv Configuration OSv

Slide 28

Slide 28 text

Packaging Services pull Base App repository run search new App ops commit push run util OSv OSv OSv Packaging OSv

Slide 29

Slide 29 text

Packaging Services Repository operations search pull user/app - download pre built image push user/app - upload a new image to the repository VM operations run app - start OSv instance kill app - kill a running OSv node VM interactions app deploy bar.jar - deploy a jar to an instance app deploy foo.rpm - add a RPM to an instance run app cli - open an interactive shell OSv OSv OSv Packaging OSv

Slide 30

Slide 30 text

Log / Trap Service OSv OSv OSv Log Traps Requirements Log Traps Direction Outbound Outbound Bandwidth High Low Reliable No Yes Format Binary/Text Binary/Text Alternatives RabbitMQ ZeroMQ Gelf ... See Log SNMP MQTT JMX

Slide 31

Slide 31 text

Alpha Release 3/2014 Optimized ZFS cache Dirty page writeback JVM page table HV support: GCE, VMW, VBox Git init osv, 12/201 2 Java hello world, 01/2013 support for 64 vcpu 02/2013 UDP, 03/2013 ZFS support > 1Gbps netperf, 6/2013 Cassandra outperform s Linux, 8/2013 Native REST API Memcached gain > 70% 1/2014 Cli and web interface 9/2014 Tomcat, HAProxy modules 10/2013 Net channels JVM ballooning >47Gbps netperf 2/2014 Image Repository JVM Read barrier elimination DPDK support More ... Roadmap

Slide 32

Slide 32 text

So what about containers?

Slide 33

Slide 33 text

Containers ● Docker is awesome ○ Linux control groups not so awesome... ● Fast boot ● Fast provisioning ● Performance

Slide 34

Slide 34 text

Containers under the hood ● Shared kernel image ○ Kernel upgrades ○ Hardware maintenance ● Complexity in the kernel ● Copy-on-write userspace

Slide 35

Slide 35 text

OSv - best of both worlds? ● Fast boot, fast provisioning, performance ● Virtualized ○ Live migration ○ Elasticity ○ MMU access ● Great blog post on Google+ “OSv vs containers” by Glauber Costa

Slide 36

Slide 36 text

That’s it!

Slide 37

Slide 37 text

Thank you! ● Web ○ http://osv.io ● Github ○ http://github.com/cloudius-systems/osv ● Mailing List ○ [email protected] ● You should follow us on Twitter: ○ @CloudiusSystems ○ @penberg ○ @TzachL