OSv - A Modern Semi-POSIX LibraryOS 
Glauber Costa, Lead Engineer 
glommer@cloudius-systems.com
Typical Cloud Stack 
Application 
Runtime 
Operating System 
Hypervisor 
Hardware 
Protection 
and 
abstraction
Containers 
Application 
Runtime 
Application 
Runtime 
Operating System 
Hardware 
● high simplicity 
● high resource efficiency 
● high performance
“Library OS” 
Application 
Runtime + OS 
Application 
Runtime + OS 
Hypervisor 
Hardware 
● high simplicity 
● high resource efficiency 
● high performance 
● high isolation
Architecture 
● Only one application / many threads 
● Single address space 
● Network channels 
● Written in C++11 
● User API - REST 
● BSD licenced 
● ZFS filesystem
Not the only one out there 
● Other examples: Erlang-on-Xen, Mirage, ClickOS. 
● But runs on wide range of Hypervisors 
○ Xen, KVM/Qemu, VMWare, VirtualBox. 
● Supports a quasi-POSIX API. 
○ no fork(), no exec(), 
○ largely Linux compatible. 
● Less than 1s boot time. 
○ as fast as needed, not as fast as possible.
quasi-POSIX 
● Allow unmodified applications to work, 
● and modified applications to shine.
Performance 
● System calls are free 
○ context switches are really cheap ( x 4 Fedora) 
● Network performance significantly faster 
○ around 20 % with netperf over Fedora Linux 
○ more than 50 % for some UDP workloads 
● I will show you concrete results at the end
What do people think? 
Roman Shaposhnik, Bigtop/Hadoop 
"Mark my words, GridGain [...] and OSv [...] are going to 
be excitingly disruptive in the next few years. […] And, 
by the way, if, after reading this blog, you are not 
dropping everything and porting your cloud application 
to OSv, I don’t know what’s wrong with you." 
http://blog.gopivotal.com/pivotal/features/pivotal-debuts-at-apachecon-north-america-2014-thanks-for-having-us
The Xen Situation 
● We like HVM because it brings greater flexibility 
○ Xen's HVM boot is really slow 
○ Other than that, all other goodies are there 
■ interrupt injection, pv devices, etc. 
● PVH is viable, but no one looking at the moment. 
○ We take patches! 
● PV out of question 
○ too complex, 
○ technically not possible.
The Xen Situation - cont 
Stack 
Current Frame 
128-byte Red Zone 
region 
The Xen Hypervisor does NOT 
respect that!
Will my application be fast? 
● short answer: 
○ yes 
● short answer 2: 
○ no 
● Similar to Ahmdal's law, in the context of parallelism 
○ no gains for 95 % CPU hungry userspace applications 
● POSIX APIs poses a limitation.
Fresh from the Oven 
● Cassandra NoSQL 
● OSv vs CentOS 7 
● up to 25 % faster reads 
○ 1 VCPU only
redis 
● up to 80 % faster than 
Ubuntu 14.04 
○ 10 Gb networking 
○ No specialized interfaces 
○ we do have some problems, 
though 
○ check our blog about it, details at 
http://osv.io/blog/
memcached 
● unmodified, 
○ brings a juicy improvement out of the box. 
● modified: 
○ that showcases the real performance opportunity behind OSv. 
That's already ~20 % 
more at http://osv.io/benchmarks/
To know more 
http://osv.io 
https://github.com/cloudius-systems/osv 
@CloudiusSystems 
osv-dev@googlegroups.com

XPDS14 - OSv - A Modern Semi-POSIX LibraryOS - Glauber Costa, Cloudius Systems

  • 1.
    OSv - AModern Semi-POSIX LibraryOS Glauber Costa, Lead Engineer glommer@cloudius-systems.com
  • 2.
    Typical Cloud Stack Application Runtime Operating System Hypervisor Hardware Protection and abstraction
  • 3.
    Containers Application Runtime Application Runtime Operating System Hardware ● high simplicity ● high resource efficiency ● high performance
  • 4.
    “Library OS” Application Runtime + OS Application Runtime + OS Hypervisor Hardware ● high simplicity ● high resource efficiency ● high performance ● high isolation
  • 5.
    Architecture ● Onlyone application / many threads ● Single address space ● Network channels ● Written in C++11 ● User API - REST ● BSD licenced ● ZFS filesystem
  • 6.
    Not the onlyone out there ● Other examples: Erlang-on-Xen, Mirage, ClickOS. ● But runs on wide range of Hypervisors ○ Xen, KVM/Qemu, VMWare, VirtualBox. ● Supports a quasi-POSIX API. ○ no fork(), no exec(), ○ largely Linux compatible. ● Less than 1s boot time. ○ as fast as needed, not as fast as possible.
  • 7.
    quasi-POSIX ● Allowunmodified applications to work, ● and modified applications to shine.
  • 8.
    Performance ● Systemcalls are free ○ context switches are really cheap ( x 4 Fedora) ● Network performance significantly faster ○ around 20 % with netperf over Fedora Linux ○ more than 50 % for some UDP workloads ● I will show you concrete results at the end
  • 9.
    What do peoplethink? Roman Shaposhnik, Bigtop/Hadoop "Mark my words, GridGain [...] and OSv [...] are going to be excitingly disruptive in the next few years. […] And, by the way, if, after reading this blog, you are not dropping everything and porting your cloud application to OSv, I don’t know what’s wrong with you." http://blog.gopivotal.com/pivotal/features/pivotal-debuts-at-apachecon-north-america-2014-thanks-for-having-us
  • 10.
    The Xen Situation ● We like HVM because it brings greater flexibility ○ Xen's HVM boot is really slow ○ Other than that, all other goodies are there ■ interrupt injection, pv devices, etc. ● PVH is viable, but no one looking at the moment. ○ We take patches! ● PV out of question ○ too complex, ○ technically not possible.
  • 11.
    The Xen Situation- cont Stack Current Frame 128-byte Red Zone region The Xen Hypervisor does NOT respect that!
  • 12.
    Will my applicationbe fast? ● short answer: ○ yes ● short answer 2: ○ no ● Similar to Ahmdal's law, in the context of parallelism ○ no gains for 95 % CPU hungry userspace applications ● POSIX APIs poses a limitation.
  • 13.
    Fresh from theOven ● Cassandra NoSQL ● OSv vs CentOS 7 ● up to 25 % faster reads ○ 1 VCPU only
  • 14.
    redis ● upto 80 % faster than Ubuntu 14.04 ○ 10 Gb networking ○ No specialized interfaces ○ we do have some problems, though ○ check our blog about it, details at http://osv.io/blog/
  • 15.
    memcached ● unmodified, ○ brings a juicy improvement out of the box. ● modified: ○ that showcases the real performance opportunity behind OSv. That's already ~20 % more at http://osv.io/benchmarks/
  • 16.
    To know more http://osv.io https://github.com/cloudius-systems/osv @CloudiusSystems osv-dev@googlegroups.com