开源虚拟化操作系统OSv初探(一)

来源:互联网 发布:雅马哈f310与f600 知乎 编辑:程序博客网 时间:2024/05/16 05:44
OSv是专为虚拟化环境开发的操作系统,其创始人包括鼎鼎大名的KVM创立者Avi Kivity。

当前的Linux并非为虚拟化设计,包含了太多的东西,从而显得笨重而影响性能。

以下是官方的说法:

"probably the best OS for cloud workloads!

OSv is designed from the ground up to execute a single application on top of a hypervisor, resulting in superior performance and effortless management"


OSv不是linux发行版,也不是基于Linux内核。OSv是使用C++全新开发的一个操作系统。

OSv的目标是提供运行在虚拟机内部的操作系统。因此并非要取代Linux。

  • 面向虚拟机中的OS。

  • 支持Linux软件,但是不是Linux。

  • 开源。BSD协议。


作者的这句解释说的非常好。

"If you take the hypervisor as the layer for granted, then by all means OSv is an operating system. But if you look at the whole stack and you're running KVM, which is essentially Linux, OSv is basically a library that you attach your application to and you can boot directly on KVM. You're booting that application and using KVM as a containing mechanism."


传统的操作系统主要提供两类功能:硬件管理和多用户/多进程的隔离。在云环境中,OS面临的情况已经发生了很大变化。

  • 硬件型号统一为几种,而非像传统一般有众多的厂商提供的硬件产品型号。
  • 云环境中更倾向于一个OS中部署一个应用。(通过OS进行应用间隔离。这也更有利于扩展和可靠性的提升。)

OSv做了哪些优化?

真实环境下,硬件操作通常纳秒级返回,而虚拟硬件的操作通常会毫米级返回。另外由于hypervisor对VCPU的调度,指令间的延迟可能无法估计的大。

针对与此,OSv避免使用自旋锁等,通过non-blocking, lock-free algorithms, and sleeping mutexes确保不浪费CPU时间。同时尽量在虚拟化环境执行费时的操作。

其他还有统一的内存地址空间。

统一的特权级别,不再有内核和应用层的切换消耗。


JVM做了那些优化?

通过应用与内核执行在同一特权级别,避免了上下文切换的代价。

通过大页改进应用访问内存的性能。

通过暴露硬件API给JVM,提升垃圾回收等方面的性能。


目前OSv还在开发中,计划3月提供alpha版本。

从目前的benchmark看,memcached在OSv中比普通Linux上处理请求的能力有40%以上的提升。



参考:

PPT介绍:https://www.usenix.org/conference/lisa13/osv-new-open-source-operating-system-designed-cloud

官网:http://osv.io/

其他文章:https://www.linux.com/news/featured-blogs/200-libby-clark/748578-osv-the-open-source-cloud-operating-system-that-is-not-linux

中文说明:http://os.51cto.com/art/201309/412164.htm

0 0
原创粉丝点击