TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

My First Unikernel

267 点作者 the_eradicator将近 11 年前

9 条评论

enduser将近 11 年前
If it helps to add clarity to what this is about, Xen still requires a host (dom0) operating system, usually Linux but also NetBSD and OpenSolaris. Mirage OS (the basis for building your own unikernel) allows building applications as domU kernels. This is advantageous because it minimizes context-switching and allows all of the code in a Xen VM (domU) to be written in a safer language than C.<p>So the dom0 OS (Linux) still determines which devices are exposed to the Unikernel. The Unikernel implementation is simple relative to a full &quot;bare metal&quot; OS because it only needs to support the Xen interfaces to block devices, the network, etc., and does not have to deal with disk drives, ethernet controllers, etc.<p>If you are running your own hardware, you&#x27;re probably better off using something like FreeBSD + Jails or Linux + LXC (Docker). The Unikernel approach is more appropriate for situations where you want to deploy applications on Xen-based cloud infrastructure (Amazon EC2, Rackspace Cloud Servers) and do not want to waste resources or increase security risk by running a full OS. The physical servers at Amazon and Rackspace are already running a full dom0 OS (probably Linux), so running <i>another</i> full OS on top of that just to run your app is inefficient.
评论 #8110548 未加载
评论 #8110603 未加载
616c将近 11 年前
So I have been following this stuff with a lot of interest, but I am not very familiar with Ocaml and have tried looking at Mirage docs with some limited downtime.<p>If Ocaml can only handle one core and does not do SMP, how does it do in the cloud? Does this mean Mirage unikernels handle only one processor&#x2F;core in Amazon and elsewhere?
评论 #8111036 未加载
评论 #8110859 未加载
评论 #8110246 未加载
paulasmuth将近 11 年前
This sounds like an awesome and fun project to hack on!<p>However, optimizing around context switches and task preemptions is something you would usually do if your application is actually bound by IO&#x2F;context switching, is extremely latency sensitive or when you are trying to squeeze the last bits of performance out of a machine. Why did you choose to build such a microoptimized system in a garbage collected language? Doesn&#x27;t this defeat the purpose of the whole exercise?<p>I feel the need for more powerful types and built-in&#x2F;standardized exception handling too, but since performance seems to be one of your major goals, wouldn&#x27;t something like C++ be a better fit here? You&#x27;d get proper error handling and a good type system (with some tradeoffs) without a significant performance penalty.<p>On a sidenote, I agree that code written in a functional language with a strong type system tends to be easier to get right than bare C, but this doesn&#x27;t imply that all low-level code is bug ridden and unsafe. In fact the linux kernel is one of the most stable and reliable pieces of software I&#x27;ve had the pleasure to work with so far. Suggesting there is a problem with the linux kernel because it contains &quot;a large amount of C code in security-critical places&quot; seems a bit dishonest.
评论 #8110512 未加载
评论 #8111002 未加载
评论 #8113274 未加载
dkarapetyan将近 11 年前
I&#x27;m a little confused about the direction things are going in. I like high level languages and I like that the OS manages certain resources so I don&#x27;t have to. This guy is writing directly to block devices from OCaml. Don&#x27;t get me wrong it&#x27;s all pretty cool but there is some kind of dissonance there I can&#x27;t reconcile. Is Xen the new OS now?
评论 #8111291 未加载
评论 #8109823 未加载
评论 #8110134 未加载
j_s将近 11 年前
See also this discussion of MirageOS from 2.5 months ago:<p><a href="https://news.ycombinator.com/item?id=7726748" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7726748</a>
callumprentice将近 11 年前
As someone who knows nothing about lower level OS type stuff, I found this article very easy to understand, interesting and well written.<p>Sounds like a lot of fun.<p>Thank you.
shyknee将近 11 年前
Mirage was just featured on FLOSS Weekly: <a href="http://twit.tv/show/floss-weekly/302" rel="nofollow">http:&#x2F;&#x2F;twit.tv&#x2F;show&#x2F;floss-weekly&#x2F;302</a>
guilloche将近 11 年前
Since unikernel still needs to run in hypervisor, so I believe the performance is worse than docker.<p>Am I right?
n0body将近 11 年前
interesting, although the old mantra of &quot;hardware is cheap, developers are expensive&quot; is still true. you could hire 10 perl&#x2F;c&#x2F;c++&#x2F;javascript&#x2F;php&#x2F;etc dev with ease for your project, but struggle to find one ocaml dev. And even then your ocaml dev will need to know the mirage library, xen and have a good knowledge of way more stuff than your project scope<p>that said, it&#x27;s still really cool, but it&#x27;s not something i&#x27;d use, and especially not in production
评论 #8110717 未加载