如《如何提高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.05By Mark RussinovichPublished: July 24, 2007Introduction
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>
| -s |
Recurse 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刪除就可以了,但在目前使用者登入情況下這個目錄是不讓刪除的,最好是用其他使用者登入,然後刪除此目錄,然後執行上面的命令,然後在用自己的帳號登入即可。