TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

TinyKVM: Fast sandbox that runs on top of Varnish

349 pointsby perbu2 months ago

19 comments

chatmasta2 months ago
I love this. Please never stop doing what you’re doing.<p>edit: Of course you’re the top contributor to IncludeOS. That was the first project I thought of while reading this blog post. I’ve been obsessed with the idea of Network Function Virtualization for a long time. It’s the most natural boundary for separating units of work in a distributed system and produces such clean abstractions and efficient scaling mechanisms.<p>(I’m also a very happy user of Varnish in production btw. It’s by far the most reliable part of the stack, even more than nginx. Usually I forget it’s even there. It’s never been the cause of a bug, once I got it configured properly.)
nine_k2 months ago
Oh. It&#x27;s like Firecracker, only much faster 8-)<p>What I like most is the ability to instantly reset the state of the VM to a known predefined state. It&#x27;s like restarting the VM without any actual restart. It looks like an ideal course of action for network-facing services that are constantly under attack: even if an attack succeeds, the result is erased on the next request.<p>Easy COW page sharing for programs that are not written with that in mind, like ML model runners, is also pretty nice.
评论 #43360254 未加载
评论 #43363913 未加载
ruben_varnish2 months ago
Original post: <a href="https:&#x2F;&#x2F;fwsgonzo.medium.com&#x2F;tinykvm-the-fastest-sandbox-564a1c5e9b42" rel="nofollow">https:&#x2F;&#x2F;fwsgonzo.medium.com&#x2F;tinykvm-the-fastest-sandbox-564a...</a><p>You can find a bunch of posts related to this topic there as well.
laurencerowe2 months ago
This is really exciting. The 2.5us snapshot restore performance is on a par with Wasmtime but with the huge advantage of being able to run native code, albeit with the disadvantage of much slower but still microsecond interop.<p>I see there is a QuickJS demo in the tinykvm_examples repo already but it&#x27;d be great to see if it&#x27;s possible to get a JIT capable JavaScript runtime working as that will be an order of magnitude faster. From my experiments with server rendering a React app native QuickJS was about 12-20ms while v8 was 2-4ms after jit warmup.<p>I need to study this some more but I&#x27;d love to get to the point where there was a single Deno like executable that ran inside the sandbox and made all http requests through Varnish itself. A snapshot would be taken after importing the specified JS URl and then each request would run in an isolated snapshot.<p>Probably needs a mechanism to reset the random seed per request.
评论 #43361014 未加载
rwmj2 months ago
Isn&#x27;t this basically libkrun? <a href="https:&#x2F;&#x2F;github.com&#x2F;containers&#x2F;libkrun" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;containers&#x2F;libkrun</a>
wmf2 months ago
Fascinating but I&#x27;m having trouble understanding the big picture. This runs a user process in a VM with no kernel? Does every system call become a VM exit and get proxied to the host? Or are there no system calls?
评论 #43360170 未加载
评论 #43359650 未加载
评论 #43372264 未加载
oulipo2 months ago
I&#x27;m new to this area, can someone ELI5 this? What&#x27;s the difference&#x2F;advantages&#x2F;disadvantages compared to other process isolation like containers?<p>Would I use this to run a distributed infra on a server a bit like docker-compose? or it&#x27;s not related?
tuananh2 months ago
this is really cool if it works for your use cases.<p>Some notes from the post<p>&gt; I found that TinyKVM ran at 99.7% native speed<p>&gt; As long as they are static and don’t need file or network access, they might just run out-of-the box.<p>&gt; The TinyKVM guest has a tiny kernel which cannot be modified
评论 #43361397 未加载
notpushkin2 months ago
This is so cool.<p>I’m exploring micro-VMs for my self-hosted PaaS, <a href="https:&#x2F;&#x2F;lunni.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lunni.dev&#x2F;</a> – and something with such little overhead seems like a really interesting option!
Tepix2 months ago
Interesting to see the performance gain. But without file i&#x2F;o and network access, what are the use cases?
评论 #43361350 未加载
otterley2 months ago
There&#x27;s nothing in the article that suggests that it runs on top of Varnish; in fact, the author even says it&#x27;s not intended to run Varnish in it.
评论 #43367246 未加载
winternewt2 months ago
I&#x27;m curious: would it be a good idea to switch my desktop Linux pc to using huge pages across the board?
conradev2 months ago
Could this be used to migrate execution of a single program between two different machines?
评论 #43361055 未加载
评论 #43362456 未加载
评论 #43419910 未加载
dangoodmanUT2 months ago
quick someone make rust bindings
评论 #43359731 未加载
评论 #43359794 未加载
jensneuse2 months ago
Is this a modern version of CGI with process isolation?
评论 #43361586 未加载
incanus772 months ago
Not entirely what this is intended for, but does anyone have experience running an X server (or Wayland, I don&#x27;t care)?<p>I&#x27;m doing some dev (on Mac) against RDP server and occasionally have other needs like that for a client. Currently I use UTM (nice QEMU Mac frontend) along with a DietPi (super stripped-down Debian) VM for these sorts of things.<p>I&#x27;m pretty familiar with Docker, but have a good idea of what sorts of hoop-jumping might be needed to get a graphics server to run there. Wondering if there&#x27;s a simpler path.
codethief2 months ago
In case the author is around: Are there any plans to wrap this in an OCI-compliant runtime?
评论 #43367276 未加载
jedisct12 months ago
Quicky someone make Zig bindings.
gunian2 months ago
man see virtualization man happy man see it no crossplatform man sad
评论 #43360171 未加载