local cache for NAS or network folder

8

7

I am planning to build a network attached storage (NAS) server.

Is there a way to cache frequently acccessed files from the remote storage automatically on the local PC?

(I am not looking for a way to sync whole folders like rsync, but rather something that automatically and transparently caches the last accessed 50 gb of files.)

Ideally I am searching for something that caches writes as well as reads, since only one pc will be accessing the server (and one day of lost changes if the local cache is damaged would be acceptable)

I looked into windows offline files, but as far as I could tell this requires manual interaction to disconnect the server or go into offline mode in order to use the cache.

The server would probably be running Linux or freeNAS, the pc runs Windows xp, but could be upgraded to 7 if required.

HugoRune

Posted 2011-01-19T16:26:57.687

Reputation: 441

Answers

2

You and Zlatev are on the right track with Offline Files. Your NAS has to run Windows. Under the Group Policies, you'll want to configure "Slow Link Mode." Just jack the setting up to like 999999 Kbps. This essentially forces all reads and writes to the local cache. Under Slow Link, windows will only sync about once every two minutes. Also you should probably turn off the balloon reminders. They popup initially to tell you, "Hey, you are offline! We are reading and writing stuff from local cache now!!!" Durrrrrr.

On the client side, you want to turn on "automatically cache files." It automatically caches every network file you access through that UNC path, up to 25% of your disk space. That can be adjusted too.

If you have multiple folders to share and your server is using either Linux or Vista/7, then just create a dummy share folder and hardlink all the folders you want to share to that one.

Lastly, I highly recommend that you at least upgrade the client to Vista. One of Vista's improvements was differential block writes. Only the changed parts of a file are sent back to the server. Also, the Vista/7 offline files (technically called Client Side Caching) is vastly more reliable. On the server side, all it has to do is update to the latest changes in the SMB protocol. In fact, all it has to do is use SMB. So all this is possible using any network share, as long as the server end supports SMB.

Here are some technet articles.

http://technet.microsoft.com/en-us/library/bb457104.aspx

http://technet.microsoft.com/en-us/magazine/2007.11.offline.aspx

surfasb

Posted 2011-01-19T16:26:57.687

Reputation: 21 453

1

I am not sure, but possibly Windows Shared Folders Offline Availability/BranchCache might let you to do something similar. Some info here - http://technet.microsoft.com/en-us/library/cc755136.aspx

Ivan Zlatev

Posted 2011-01-19T16:26:57.687

Reputation: 391

Actually, branch cache can be set to cache everything in windows 7 pro (tested and used!) – galinette – 2015-03-09T20:54:30.607

BranchCache has nothing to do with that. Offline Folders have to be selected by the user, so there is no cache effect. ;-) – DiableNoir – 2011-06-21T16:24:12.890

0

I am looking into the same problem. On a Mac, my idea was to use rsync in combination with a script. The job of the script is to decide which files to sync/cache. Rsync then just executes efficiently on this towards the network share. So if we for example want a 5GB cache, removing least recently used, we'd need to program a script that outputs a file list corresponding to the "5GB most recently used files", and have rsync sync it locally and deleting any files in the cache that is no longer in that list.

It needs to be setup very carefully though, as the risk of messing up is big!

RipperDoc

Posted 2011-01-19T16:26:57.687

Reputation: 427