Rumprun Tutorial: Serve a static website as a Unikernel
github.com
github.com
If there is only one process, the webserver, why deal with a scheduler?
If you're not using the safety features of an OS why have them?
Why context switch if its not needed?
You're hosting a key value store on an SSD. Why deal with a file system abstraction?
Basically, as I understand it, unikernels are trying to democratize application deployment "on the metal" (or currently on xen) without the legacy fundamentals that drove the designs of OSes like Windows or Linux which were built for shared mainframes in university basements.
For more info here is Xen talking about unikernels, http://wiki.xenproject.org/wiki/Unikernels
For example, I only care about POSIX when not using "comes with batteries/repository manager" languages.
E.g.
> Why use Mirage OS?
>
> The cloud has so far mostly been used to
> consolidate existing operating systems and manage
> them more conveniently. The interface between
> guest kernels, applications and VMs are all
> managed very differently, leading to serious
> inefficiencies, unreliability and insecurity.
http://www.xenproject.org/developers/teams/mirage-os.htmlSo it's not quite about trading safety and portability, as you can retain those depending on the approach you take (eg, MirageOS currently lets you target Unix, Xen-on-x86 and Xen-on-ARM from exactly the same code-base).
You can also try out static sites in MirageOS [1] and I gave a talk at polyconf last weekend with slides at [2].
[1] http://amirchaudhry.com/from-jekyll-to-unikernel-in-fifty-li...
- Lots of different hardware and peripherals, some legacy (i.e. floppies)
- The filesystem, on top of whatever could conceivably be beneath it
- An institutional administrator and multiple users who need protection from each other, all going about their business in shells simultaneously
- Intelligent resource-sharing between lots of different processes
Unikernels rip all that out and say:
- There is only one kind of "hardware" in the universe: the supported hypervisor. No need for drivers for anything else.
- There is exactly one user with OS-level access and he can be trusted completely. (This is many servers already: the only OS-level user is the sysadmin, all non-root accounts ever do us sudo to a root shell.)
- This VM runs exactly one process (the actual application) and it can have direct access to hardware and memory. So no (or drastically reduced) need for memory protection, process scheduling, system calls, etc.
It's likely that i.e. a relational database engine with direct access to SSD firmware can be made faster than one which must go through a generic filesystem abstraction layer.
Disadvantages:
- Largely uncharted waters
- Linux is likely to be better at intelligently scheduling resources than a hypervisor, at least for the forseeable future.
> There is only one kind of "hardware" in the universe: the supported hypervisor. No need for drivers for anything else.
An explicit goal of rumprun is to support real hardware. Defining the cloud as the only supported platform makes sense if you have to write or port hardware device drivers. For rumprun those drivers come for free as rump kernel components, so if you want to link them in (optional) and run on real hardware, it's possible. Having that possibility makes sense too: your cloud platform and IoT (+) platform can be the same thing, it's just the orchestration layer that differs.+) given a large enough "T"