News for hackers. Stuff that matters.
Re:Zerg: Boot a VM instance per request, all in under 250 ms by htgb on Thursday December 28, 2017 @01:21AM (#16020666)
It's definitely impressive, kinda like an own serverless implementation.

However, is there a point in shutting down the VM right away, other than being a cool demo? It seems to me that you could quite easily keep it around if there are more requests queued, and quickly spawn more workers if the queue gets too long. So a regular worker pool, just that the number of workers can be adjusted relatively quickly.

Re:Zerg: Boot a VM instance per request, all in under 250 ms by vidarh on Thursday December 28, 2017 @04:21AM (#16021102)
Shutting them down right away achieves a number of things, such as significantly better isolation between requests, and more protection against resource leaks.

Whether that'll be worth the cost remains to be seen - 250ms is still far too long for most uses, but if it can come down enough, it's attractive.

Re:Zerg: Boot a VM instance per request, all in under 250 ms by rwmj on Thursday December 28, 2017 @05:57AM (#16021393)
I couldn't get to the site, but assuming this is running Linux I wrote a paper about how fast you could boot a Linux minimal userspace on QEMU a couple of years ago[1]. In short if you're willing to heavily customize the kernel, qemu and userspace then you can get it down to 100-150ms on i7-type hardware, but probably not much lower. Using a distro kernel, distro qemu and so on, you're stuck with 400-600ms (which is fine for certain uses, eg better security for containers like Kata Containers is doing).

Also worth noting I wrote a bunch of benchmarking tools to help optimize this case[2].

[1] http://oirase.annexia.org/tmp/paper.pdf

[2] https://github.com/libguestfs/libguestfs/tree/master/utils

Re:Zerg: Boot a VM instance per request, all in under 250 ms by vidarh on Sunday December 31, 2017 @01:02AM (#16039579)
Thanks for the links. I've looked at Clear Containers/Hyper/Kata before, and it's absolutely looking good. It's very interesting to see your work on going into details on it, though.

I really hope this can be pushed further down to the point where it gets viable to for more use cases. Of course, we can always use something lighter than Linux, but being able to start with Linux and pare down is potentially so much easier for many types of applications.

Re:Zerg: Boot a VM instance per request, all in under 250 ms by pjc50 on Thursday December 28, 2017 @05:26AM (#16021307)
> own serverless implementation

Isn't this just cgi-bin, right down to the long startup time and lack of persistence?

Re:Zerg: Boot a VM instance per request, all in under 250 ms by jxf on Thursday December 28, 2017 @06:20AM (#16021465)
It's similar in intention, but "serverless is just `cgi-bin`" misses a lot of nuance. Zerg and cgi-bin are solving different problems and with different implementations. It's extremely difficult, if not impossible in some environments, to get the same kind of isolation with cgi-bin that you do out of a VM.
Re:Zerg: Boot a VM instance per request, all in under 250 ms by catern on Thursday December 28, 2017 @09:25AM (#16022121)
You gain on isolation with Zerg (and other "VM per request" things) but you lose on everything else compared to CGI with processes.

But you can reach comparable levels of isolation with processes: just use Linux namespaces.

Re:Zerg: Boot a VM instance per request, all in under 250 ms by htgb on Thursday December 28, 2017 @06:19AM (#16021461)
Is it? I'm under the impression that cgi-bin is a way to serve requests from the local computer, while Zerg is a way to spawn _other_ server instances to handle the request (and in Erlang, specifically).
Re:Zerg: Boot a VM instance per request, all in under 250 ms by pjc50 on Thursday December 28, 2017 @06:55AM (#16021566)
Yes, but you could let a load balancer handle that for you, and you might not need as many computers to handle the requests if it didn't take 250ms to start.
Re:Zerg: Boot a VM instance per request, all in under 250 ms by sitkack on Thursday December 28, 2017 @07:43AM (#16021714)
Booting a VM should be "as complex" as fork. And the memory image of the booted OS should be identical on each load before the end user specific data is loaded.

"Prefork" these VMs by spraying that image over physical memory in advance, jump to them on a request. memcopy a new VM over them on exit.

VM spawn rate should be the memcopy rate, if the MMU is powerful enough, should only be the amount of memory mutated during a request.

Re:Zerg: Boot a VM instance per request, all in under 250 ms by hanbura on Thursday December 28, 2017 @08:05AM (#16021772)
I have written a few web services in the past where this kind of isolation would have been great. Services doing file conversion of untrusted input with software that isn't hardened for that case (in my case converting PDF to png and postscript).
Re:Zerg: Boot a VM instance per request, all in under 250 ms by regularfry on Thursday December 28, 2017 @03:25AM (#16020967)
The point is that you don't need the added complexity of a worker pool. It's another thing to break, so why bother?
Re:Zerg: Boot a VM instance per request, all in under 250 ms by michaelmior on Thursday December 28, 2017 @03:49AM (#16021024)
Even 250ms latency to boot is significant. Especially if you're processing thousands of requests per second.
Re:Zerg: Boot a VM instance per request, all in under 250 ms by NegativeLatency on Thursday December 28, 2017 @03:52AM (#16021031)
Or if you are processing more than 4 per core per second.
Re:Zerg: Boot a VM instance per request, all in under 250 ms by imtringued on Thursday December 28, 2017 @05:35AM (#16021331)
Threads take milliseconds to start yet we still use thread pools.