您尚未登录。

楼主 # 2022-01-19 12:50:35

aozima
会员
所在地: 深圳
注册时间: 2019-05-25
已发帖子: 449
积分: 316.5
个人网站

VMware虚拟机共享windows目录性能调优小技巧

有在windows上面使用VMware Player虚拟机,并使用使用vmhgfs挂载windows上面的目录,使用上倒是挺方便。
但是编译大些的项目,相比虚拟机里面的linux上面ext4文件系统就慢多了。

现在调整了一缓存相关的参数,快多了。以编译F133的工程为例,原来2分半,现在20秒。
具体参数细节可以再自己研究调整下。

当然,有了缓存意味着2边同步的时间会变长,不过我的应用主要是在win上面编写和调试。linux里面用docker主要做编译工作,所以两边不会对同一个文件进行读写,且两边切换是手动的,过程至少也要几秒,所以问题不大。

$ vmhgfs-fuse -h

$ vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other,entry_timeout=3,negative_timeout=3,attr_timeout=3,auto_cache

测试好后建议直接写到`/etc/fstab`中

$ cat /etc/fstab
...
.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other,entry_timeout=3,negative_timeout=3,attr_timeout=3,defaults 0 0

vm+vmhgfs 默认参数

$ vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other
$ time scons -j12
real    2m27.556s
user    0m35.779s
sys     0m46.991s

vm+vmhgfs 调整参数

$ vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other,entry_timeout=3,negative_timeout=3,attr_timeout=3,auto_cache
$ time scons -j12
real    0m20.262s
user    0m50.965s
sys     0m21.402s

vm+ext4

$ time scons -j12
real    0m9.358s
user    1m4.950s
sys     0m19.415s

离线

#1 2022-01-19 13:16:31

ubuntu
会员
注册时间: 2020-03-30
已发帖子: 227
积分: 205

Re: VMware虚拟机共享windows目录性能调优小技巧

试了一下,确实比以前快,由于磁盘转得够快,把我的USB鼠标都弄得一卡一卡的。

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn