OSv: probably the best OS for cloud workloads you've never hear of

9,044 views

Published on

OSv is the revolutionary new open source technology that combines the power of virtualization and micro-services architecture. This combination allows unmodified applications deployed in a virtualized environment to outperform bare-metal deployments. Yes. You've heard it right: for the first time ever we can stop asking the question of how much performance would I lose if I virtualize. OSv lets you ask a different question: how much would my application gain in performance if I virtualize it. This talk will start by looking into the architecture of OSv and the kind of optimizations it makes possible for native, unmodified applications. We will then focus on JVM-specific optimizations and specifically on speedups available to big data management distributed applications. Finally, we will look into the relationship between OSv and Docker and how that layering can help make OSv a secret sauce for turbo-charging Cloud Foundry application deployments.

Published in: Software, Technology

OSv: probably the best OS for cloud workloads you've never hear of

  1. 1. © 2014
  2. 2. OSv: PROBABLY THE BEST OS FOR CLOUD WORKLOADS YOU'VE NEVER HEARD OF Roman Shaposhnik @rhatr, Pivotal Inc.
  3. 3. Why do we dig PaaS?
  4. 4. ‘cuz its awesome!
  5. 5. No, but seriously? myApp $ cf push … service #N service #1 … service #Z service #M …
  6. 6. What about stateful? HDFS Zookeeper HBase region server … I am alive Who Am I? What do I do? HBase region server
  7. 7. And when it fails? HDFS Zookeeper HBase region server … Node died You, pitch in! Aye, aye captain
  8. 8. μservice-based deployment HDFS Zookeeper HBase region server … I am alive Who Am I? What do I do? HBase region server
  9. 9. Lets zoom in … service #N service #1
  10. 10. Anatomy of a μservice Hardware “Stuff” [Java] Virtual Machine μservice code
  11. 11. How are we doing it today? Hardware pkg1 [Java] Virtual Machine μservice code pkgN…………. “OS”Linux kernel Puppet, Chef Huge VM image
  12. 12. Is there a better way? vHardware Hardware [Java] Virtual Machine libFS, libC, libJVM μservice code Application-specific static linking Tiny VM image AKA unikernel Hardware-assisted virtualization
  13. 13. What the heck is a FOOkernel? • What OS design courses have taught us? – microkernels vs. monolithic kernels • What did they left behind? – exokernels, nano • What they should’ve taught us instead: – unikernels, anykernels
  14. 14. Unikernels • “Unikernels: library operating systems for the cloud” came out in 2013 • A “library” operating system • A kernel that can only support one process
  15. 15. Anykernels • Programming discipline for kernel code reuse • “The Design and Implementation of the Anykernel and Rump Kernels” by A. Kantee • Capabilities – NetBSD filesystems as Linux processes – User-space TCP/IP stack
  16. 16. OSv from Cloudius Systems • A unikernel for “POSIX” and memory managed platforms (JVM, Go, Lua) • Anykernel’ish – E.g. ZFS • Runs on top of KVM, Xen, VirtualBox, VMWare • Looks like an app to the host OS • Small, fast and easy to manage at scale
  17. 17. OSv manifesto • Run existing Linux applications • Run existing Linux applications faster • Make boot time ~= exec time • Explore APIs beyond POSIX • Leverage memory managed platforms (JVM, Go) • Stay open
  18. 18. What’s inside? single address space in “kernel mode” “kernel threads” “user threads” diskZFS virtioC++ kernel code dynamic linker libjvm.soifconfig.so TCP/IP iface
  19. 19. Anything it can’t do? • A 100% replacement for a Linux kernel – No fork()ing • No process isolation • The least amount of device drivers ever
  20. 20. Virtualization vs. performance • Network-intensive apps: – unmodified: 25% gain in throughput 47% decrease in latency – non-POSIX APIs use for Memcached: 290% increase in performance • Compute-intensive apps: – YMMV
  21. 21. Van Jacabson’s net channels socket TCP IP iface socket TCP IP iface lock lock lock Traditional TCP/IP stack app thread kernel (IRQ) send/recv socket TCP IP iface channel classifier iface lock OSv TCP/IP stack app thread kernel (IRQ) send/recv
  22. 22. Memory management in UNIX OS Memory Process Memory JVM Heap Process Memory JVM Heap
  23. 23. Memory management in OSv OS Memory Process Memory JVM Heap
  24. 24. JVM balooning (no more -Xmx) JVM Heap OS object
  25. 25. Turbo charging JVM GC object 1 object 2
  26. 26. Turbo charging JVM GC object 1 object 2
  27. 27. Turbo charging JVM GC object 1 object 2 CPU MMU assisted tracking table
  28. 28. But what about Docker? Jailed FS, net, etc. Hardware [Java] Virtual Machine libFS, libC, libJVM μservice code Application-specific static linking Docker image Common, shared kernel
  29. 29. Docker != LXC • $ docker run roman/PetClinic • Socially-driven image sharing Ubuntu 14.04 Canonical Tomcat Pivotal Go Google PetClinic Roman PetClinic service #N service #1 $ docker run
  30. 30. Why should it work this time? • Unikernels/exokernels back in ’90 • JVM-on-bare-metal (Azul, BEA, etc.) back in ‘00 • Things they didn’t have back then – HW-assisted virtualization (KVM, XEN, etc.) – Elastic infrastructure oriented architectures – CloudFoundry
  31. 31. Elastic, next generation datacenter • Commodity, rack-provisioned Hardware • Commodity, JeOS to get to Docker++ – CoreOS, SmartOS • Docker++ as a common backed • OSv (really KVM, XEN) • “GitHub” for μservies images
  32. 32. Finally killing DevOps • Ops (IT) maintains the bare OS • Devs maintain the images
  33. 33. Finally killing DevOps • Ops (IT) maintains the bare OS • Devs maintain the images
  34. 34. Guinea pigs so far • Cloudius – Memcached – Apache Cassandra – Redis • Pivotal – Hadoop ecosystem
  35. 35. Where do we need your help? • All of the above ;-) • CloudFoundry integration – $ cf push roman/petclinic ? – Docker registry as a backend for BuildPacks ? – Two-level scheduling for Hadoop ecosystem
  36. 36. Questions? By @cloud_opinion Imagine no platforms I wonder if you can No need for PAAS or IAAS A brotherhood of bare metal Imagine there is no VM It's easy if you try No host below us Above us only apps

×