Live data from Hacker News

MirageOS 4.0 – Self-managed internet infrastructure with unikernels

mirage.io

31–38 of 38 posts

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#31
post #5
post #3

This project mentions it’s based on the Xen hypervisor and uses EC2 as an example for running it, but haven’t AWS now moved to their own KVM based hypervisor? Would this still work?

You can still choose Xen-based instances in EC2.

This isn't good advice. People should probably use the hvt backend on AWS.

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#32
post #11

Earlier quoted context omitted.

In ancient times, only Xen was supported. Nowadays, the support moved to: - Xen (PVH) - Linux KVM, FreeBSD BHyve, OpenBSD VMM - SPT (seccomp, no hardware virtualization) - virtio (GCE, ..) - muen (muen.sk) Take a look at https://github.com/solo5/solo5 which is used as the low level bits to run OCaml.

> - SPT (seccomp, no hardware virtualization) To be clear, this means running an ordinary Linux binary, right? I'm curious about the remaining advantages in practice of running multiple processes on a shared kernel rather than using hardware virtualization. I guess the main one is more efficient resource pooling, particularly memory and the page cache. I understand the primary advantage of virtualization is a smaller…

One of the stated advantages various places of having a unikernel build as a regular ELF binary on Linux or BSD (including the semi-BSD macOS) is that you can use it as your instrumented debug build very easily. Yes, you can instrument your app heavily. You can have console output. You can log to a mounted volume, to an object store, or to a remote log server with rsyslog or something like Elastic. But with an ELF binary on an OS you can strace, dtrace, fence it, run it under gdb or another debugger, instrument the OS under it, or whatever. Then the same source code builds essentially the same program to run right on KVM or Xen with no OS under it for security and efficiency.

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#33
post #30
post #21

Earlier quoted context omitted.

Conurrency instead of parallelism.

No amount of concurrency on a single core can equal the performance of multiple cores.

That is why you deploy a process per core, with affinity so that it doesn't jump around.

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#34
post #30
post #21

Earlier quoted context omitted.

Conurrency instead of parallelism.

No amount of concurrency on a single core can equal the performance of multiple cores.

You can run more than one unikernel per machine. That's why things like KVM or Bhyve are targets instead of just bare metal.

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#35
post #10
post #6

Earlier quoted context omitted.

Ahh ok. I imagine you would lose all the nice Nitro stuff though like enhanced networking etc which is a bummer.

There is Xen-on-Nitro, which AWS developed to continue to support customers using Xen to run on EC2 instances featuring Nitro: https://perspectives.mvdirona.com/2021/11/xen-on-nitro-aws-n...

That’s great to know, thank you

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#36
post #26

Earlier quoted context omitted.

What about multiprocessing? I assume that MirageOS can take advantage of multiple cores (or do you need separate instances per core?). In this case is the system still shared memory? Also I would say there are reasons for isolation beyond memory safety.

MirageOS is - similar to the latest OCaml release - only using a single CPU core. You can run multiple unikernels, one on each core. If doing that, you can use Xen vchan (shared memory), or TCP for marshalling. > Also I would say there are reasons for isolation beyond memory safety. Would you mind to elaborate which reasons you are thinking of?

> only using a single CPU core

How does it go when you deploy a unikernel on EC2 (or on any IaaS where the hypervisor is managed unlike bare-metal) with multiple cores? Is there a way to start a unikernel per core on a single instance, or are you bound to use single core instance types only?

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#37
post #29

Does MirageOS exclusively support native Ocaml applications? Or does it appear to applications like a standard OS, so you can develop with anything? For example, they show how you can host a static site. Great, but can I run my Flask API?

MirageOS is indeed only for OCaml.

If you want a POSIX unikernel have a look at Unikraft.

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#38
post #26

Earlier quoted context omitted.

What about multiprocessing? I assume that MirageOS can take advantage of multiple cores (or do you need separate instances per core?). In this case is the system still shared memory? Also I would say there are reasons for isolation beyond memory safety.

MirageOS is - similar to the latest OCaml release - only using a single CPU core. You can run multiple unikernels, one on each core. If doing that, you can use Xen vchan (shared memory), or TCP for marshalling. > Also I would say there are reasons for isolation beyond memory safety. Would you mind to elaborate which reasons you are thinking of?

> MirageOS is - similar to the latest OCaml release - only using a single CPU core.

Thanks. Is that going to change now that OCaml is finally getting proper multicore support?

>> Also I would say there are reasons for isolation beyond memory safety. >Would you mind to elaborate which reasons you are thinking of?

Memory safety in a sense protects the integrity of the 'runtime', but only partially help to protect business level integrity. A task might still tricked (by mistake or malice) to access objects it is not supposed to. I'm sure that OCaml has enough abstractions to help prevent that, but full isolation of tasks is a blunt and effective tool.

Post reply on HN