osv: probably the best os for cloud workloads you've never heard of (cloud foundry summit 2014)
DESCRIPTION
Technical Track presented by Roman Shaposhnik, Sr. Manager, Hadoop at Pivotal. 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.TRANSCRIPT
![Page 1: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/1.jpg)
© 2014
![Page 2: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/2.jpg)
OSv: PROBABLY THE BEST OS FOR CLOUD WORKLOADS YOU'VE NEVER HEARD OF
Roman Shaposhnik @rhatr, Pivotal Inc.
![Page 3: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/3.jpg)
Why do we dig PaaS?
![Page 4: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/4.jpg)
‘cuz its awesome!
![Page 5: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/5.jpg)
No, but seriously?
myApp $ cf push …
service #N
service #1
…
service #Z
service #M
…
![Page 6: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/6.jpg)
What about stateful?
HDFS
Zookeeper
HBaseregionserver
…I am aliveWho Am I?What do I do?
HBaseregionserver
![Page 7: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/7.jpg)
And when it fails?
HDFS
Zookeeper
HBaseregionserver
…Node diedYou, pitch in!Aye, aye captain
![Page 8: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/8.jpg)
μservice-based deployment
HDFS
Zookeeper
HBaseregionserver
…I am aliveWho Am I?What do I do?
HBaseregionserver
![Page 9: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/9.jpg)
Lets zoom in
…
service #N
service #1
![Page 10: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/10.jpg)
Anatomy of a μservice
Hardware
“Stuff”
[Java] Virtual Machine
μservice code
![Page 11: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/11.jpg)
How are we doing it today?
Hardware
pkg1
[Java] Virtual Machine
μservice code
pkgN………….“OS”Linux kernel
Puppet, Chef
Huge VM image
![Page 12: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/12.jpg)
Is there a better way?
vHardware
Hardware
[Java] Virtual MachinelibFS, libC, libJVM
μservice code
Application-specificstatic linking
Tiny VM image AKA unikernel
Hardware-assisted virtualization
![Page 13: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/13.jpg)
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
![Page 14: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/14.jpg)
Unikernels• “Unikernels: library operating systems for the
cloud” came out in 2013• A “library” operating system• A kernel that can only support one process
![Page 15: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/15.jpg)
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
![Page 16: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/16.jpg)
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
![Page 17: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/17.jpg)
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
![Page 18: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/18.jpg)
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
![Page 19: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/19.jpg)
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
![Page 20: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/20.jpg)
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
![Page 21: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/21.jpg)
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
![Page 22: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/22.jpg)
Memory management in UNIX
OS Memory
Process Memory
JVM Heap
Process Memory
JVM Heap
![Page 23: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/23.jpg)
Memory management in OSv
OS Memory
Process Memory
JVM Heap
![Page 24: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/24.jpg)
JVM balooning (no more -Xmx)
JVM Heap
OS object
![Page 25: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/25.jpg)
Turbo charging JVM GC
object 1 object 2
![Page 26: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/26.jpg)
Turbo charging JVM GC
object 1 object 2
![Page 27: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/27.jpg)
Turbo charging JVM GC
object 1 object 2
CPU MMU assisted tracking table
![Page 28: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/28.jpg)
But what about Docker?
Jailed FS, net, etc.
Hardware
[Java] Virtual MachinelibFS, libC, libJVM
μservice code
Application-specificstatic linking
Docker image
Common, shared kernel
![Page 29: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/29.jpg)
Docker != LXC• $ docker run roman/PetClinic• Socially-driven image sharing
Ubuntu 14.04
Canonical
Tomcat
Pivotal
Go
PetClinic
Roman
PetClinic
service #N
service #1$ docker run
![Page 30: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/30.jpg)
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
![Page 31: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/31.jpg)
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
![Page 32: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/32.jpg)
Finally killing DevOps• Ops (IT) maintains the bare OS• Devs maintain the images
![Page 33: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/33.jpg)
Finally killing DevOps• Ops (IT) maintains the bare OS• Devs maintain the images
![Page 34: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/34.jpg)
Guinea pigs so far• Cloudius
– Memcached– Apache Cassandra– Redis
• Pivotal– Hadoop ecosystem
![Page 35: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/35.jpg)
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
![Page 36: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/36.jpg)
Questions?
By @cloud_opinion
Imagine no platformsI wonder if you canNo need for PAAS or IAASA brotherhood of bare metal
Imagine there is no VMIt's easy if you tryNo host below usAbove us only apps
![Page 37: Osv: Probably the Best OS for Cloud Workloads You've Never Heard Of (Cloud Foundry Summit 2014)](https://reader038.vdocument.in/reader038/viewer/2022110115/54c6df954a7959fc3e8b4569/html5/thumbnails/37.jpg)