How could I limit or even disable file cache on Windows Server 2008R2?
There is a machine, with a very fast RAID array, and a fast internet connection. But, it only got 8gb of mem, which runs out really quick, when the upload goes up.
Any ideas how could I disable, or limit the cache?
(I have tried disabling Write Cache from Device Manager. But that's just write cache, and it didn't help.)
Solution 1:
The whole point of the cache is that it uses unused ram, and gives it up as soon as an application requests more. Thus, you don't want to limit its size as doing so would just leave the free ram completely wasted.
Solution 2:
You have to call the system API SetSystemFileCacheSize()
Documented here: http://msdn.microsoft.com/en-us/library/aa965240.aspx
Some GUI programs allow it: http://technet.microsoft.com/en-us/sysinternals/bb897561
But you may prefer CLI, to automaticaly run it at system startup: http://www.uwe-sieber.de/ntcacheset_e.html (look in the middle of the page, it works for 2k8)
Or just write a powershell script calling SetSystemFileCacheSize()
Note it is strongly discouraged to disable the cache for production use.
It is frequent to limit the cache size to a small value for virtualized machines, not to disable it.