Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2308659
  • 博文数量: 310
  • 博客积分: 6853
  • 博客等级: 准将
  • 技术积分: 2833
  • 用 户 组: 普通用户
  • 注册时间: 2005-08-04 16:41
文章分类

全部博文(310)

文章存档

2013年(17)

2012年(42)

2011年(76)

2010年(71)

2009年(99)

2007年(2)

2006年(1)

2005年(2)

分类: WINDOWS

2009-12-30 14:28:16

I’ve always wondered why Windows doesn’t allow you to set an arbitrary size for the filesystem cache. What if you have a slow hard drive in your laptop, but loads of available system memory? Shouldn’t you be able to maximize that memory in order to speed up hard drive access?

I’ve found a slightly documented tweak that will allow you to tell Windows to use more cache for the NTFS “pool”, which should increase performance if your system opens and closes a lot of files all the time like mine does.

According to the Microsoft documentation:

Increasing physical memory does not always increase the amount of paged pool memory available to NTFS. Setting memoryusage to 2 raises the limit of paged pool memory. This might improve performance if your system is opening and closing many files in the same file set and is not already using large amounts of system memory for other applications or for cache memory. If your computer is already using large amounts of system memory for other applications or for cache memory, increasing the limit of NTFS paged and non-paged pool memory reduces the available pool memory for other processes. This might reduce overall system performance.

I’ll be testing this change out myself, and I really hope to get feedback from our excellent readers on this one. Please note that I’ve not run any benchmarks yet, so I can’t confirm yet that this yields any major benefit in real-world performance.

Command Line Hack

Open up an Administrator mode command prompt by right-clicking and choosing Run as Administrator, or type in cmd into the start menu search box and use Ctrl+Shift+Enter.

Type in the following command to increase the cache setting:

fsutil behavior set memoryusage 2

To check the current value, type in this command:

fsutil behavior query memoryusage

To change the setting back to the default, use this command:

fsutil behavior set memoryusage 1

image

As always, these “slightly” documented settings can screw up your system, so perform at your own risk. Also, you’ll likely have to reboot the machine to see any difference.

Manual Registry Hack

You can also set this value by changing a registry parameter. Open up regedit.exe through the start menu search or run box, and then navigate down to the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

image

Double-click on the NtfsMemoryUsage key on the right-hand side and change the value to 2. Here’s the available values:

  • Not Set: 0
  • Set to Default: 1
  • Increase Cache: 2

According to the documentation the default setting is “1″, but by default the key is set to “0″. Typically in that scenario the setting of “0″ means “Not Set”, which means the system uses the default setting. You should be able to change the value to either “0″ or “1″ in order to change this back to default.

This setting also works in Windows Server 2003.

阅读(2224) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~