用Ramdisk进一步提高虚拟机(VMWare)的性能

如《如何提高vmware5 的性能》所述,通过设置关闭VMWare的虚拟内存文件能够让VMware真正的运行在物理内存中,我在VMWare中安装的是客户机WindowsXP,通过设置关闭WindowsXP的虚拟内存,让所有程序都运行在物理内存中,这样速度又有了很大的提高。

但是,测试运行过程中发现,虚拟机硬盘访问速度逐渐成为瓶颈,速度不能进一步提高了。那怎么办呢?我想到可以用虚拟硬盘的方法(RamDisk),让频繁读写的数据特别是某些临时文件放在RamDisk中,这样可以让虚拟机硬盘的瓶颈进一步减小。

选用了SuperSpeed RamDisk Plus实现虚拟硬盘(RamDisk),具体的设置非常简单,这里就不说了。下面说一下IE如何使用RamDisk提高性能。看下面这张图就差不多了:

 

这样IE下载的所有的临时文件都放置在了RamDisk中,速度有很大提高。但是有个瑕疵,IE的Cookies还是放在C:/Documents and Settings/user/Cookies目录下,能不能将这个目录也放在RamDisk中呢?

IE的Cookies放置目录好像不能设置,只能用一些其他技巧了。什么呢?Linux下可以将一个目录直接映射到另一个目录,也就是链接的概念,Windows下有没有这样的东东呢?快捷方式的概念有点像,但是不完全相同,比如我在c:/建立一个快捷方式temp指向d:/temp,我们可以双击快捷方式进入到d:/temp,但如果打开Cmd,敲入cd c:/temp,会提示说没有此目录,也就是说c:/temp和d:/temp不相等。

经过查找确实有这么一个东西是做这个用的,那就是junction

Junction v1.05

By Mark Russinovich

Published: July 24, 2007


Introduction

Windows 2000 and higher supports directory symbolic links, where a directory serves as a symbolic link to another directory on the computer. For example, if the directory D:/SYMLINK specified C:/WINNT/SYSTEM32 as its target, then an application accessing D:/SYMLINK/DRIVERS would in reality be accessing C:/WINNT/SYSTEM32/DRIVERS. Directory symbolic links are known as NTFS junctions in Windows. Unfortunately, Windows comes with no tools for creating junctions—you have to purchase the Win2K Resource Kit, which comes with the linkd program for creating junctions. I therefore decided to write my own junction-creating tool: Junction. Junction not only allows you to create NTFS junctions, it allows you to see if files or directories are actually reparse points. Reparse points are the mechanism on which NTFS junctions are based, and they are used by Windows' Remote Storage Service (RSS), as well as volume mount points.

Please read this Microsoft KB article for tips on using junctions.

Note that Windows does not support junctions to directories on remote shares.

If you want to view reparse information, the usage for Junction is the following:

 

Using Junction

Usage: [-s] <directory or file name>

-sRecurse subdirectories


If you want to create or delete a junction, use Junction like this:

Usage: [-d] <junction directory> [<junction target>]

To delete a junction specify the -d switch and the junction name.

 

可以在这儿下载:Junction

有了Junction就可以实现Cookies也放在RamDisk了,junction "C:/Documents and Settings/user/Cookies" R:/Cookies。

注意的是,直接执行上面的命令会出现错误,要把C:/Documents and Settings/user/Cookies删除就可以了,但在当前用户登录情况下这个目录是不让删除的,最好是用其他用户登录,然后删除此目录,然后执行上面的命令,然后在用自己的账号登录即可。

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值