NFS overhead when requested data is already in memory...

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
I was looking into seting up a trio of load balanced web servers, all NFS-mounting thier /htdocs directory from a single fileserver (so that I only have to keep and manage one copy of the site files).

But it occured to me this might not work. The webservers have plenty of ram, and will eventually have cached most of the site, but then what if I change something on the file server, how will it know to refresh its cache of those files?

Does it check the file server each time something is requested? That'll probably be way to much overhead.

Do NFS Servers automatically tell clients when things have changed? I can't really imagine that being the case.

Basically, I don't want A.) An NFS call for every file requested and B.) Stale copies of files in memory

Is this setup doomed?

bart
 

Heisenberg

Lifer
Dec 21, 2001
10,621
1
0


<< thanks but there aren't any windows machines in this cluster >>



I don't know the answer to your question but I just love hearing that phrase. :D

Doesn't this have more to do with virtual memory management in general? If a local file is in memory and then changed, how does the kernel know it has been changed the next time it's accessed (and therefore know to use the file on the drive, not the one in the memory)? It was my understanding that NFS mounts are treated almost identically to locally mounted filesystem. I apologize if I'm way off base with this.
 

LNXman

Senior member
Jul 27, 2000
404
0
0
I am assuming you are using LINUX:

You can check out these patches for NFS clients to improve their performance. Hopefully you have time to play around with the patches, but I think the nfs-refresh-inode4 might help with what you are trying to accomplish.

Another thing you can do. Is have a synching box, which holds the /htdocs structure that all your Web servers and going to be using. Such that everything you do (add/change) to the synching box, you can rsync, or rdist, to all the Web servers. This approach avoids dealing with NFS client caching completely, but I am not saying it is the best.
Maybe when NFSv4 comes out, these issues will be taken care of. . . .

Just a thought. ;)

GL
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Just wanted to second LNXman's suggestion. That is probably how I would handle it. You can even setup a cronjob to rsync the directories (over ssh even ;)) every 10 minutes or so. That would be a minimum of transfers and whatnot. Should be pretty easy. Also, NFS' performance is supposed to be pretty bad when you compare pretty much any OS vs Solaris. I havent personally used it though.
 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
yea my backup was a system of rsync scripts, I just thought the NFS would be the cleanest and most flexible.

Thanks for the links LNXman, I'll read through them tonight

bart
 

DaHitman

Golden Member
Apr 6, 2001
1,158
0
0
Both Solaris and HPUX(the love of my life) have a cool feature called CACHEFS that does this sort of thing very well.. its made for diskless workstations that basically run EVERYTHING off an NFS server... but thats almost identical to what you want to do... it also lets you continue to work even if the NFS server goes down.

Read this:
http://sunsite.nstu.nsk.su/sunworldonline/swol-01-1996/swol-01-cachefs.html

http://sundocs.princeton.edu:8888/ab2/coll.47.10/SYSADV1/@Ab2PageView/44952



I was just at the LISA (Large Installation Systems Administration) Conference a few months ago, and I met the guy in charge of CNN's web site, and they used a bank of Network Appliance NFS Applicances to do this sort of thing... they have many servers and almost a terrabyte of backend storage too.. so apparently it works pretty well..

BTW, LISA is THE BEST CONFERENCE there is... and I have been to quite a few..

QUICK Plug for SAGE, the Systems Administrators Guild which I am a member of and USENIX Association which I am also a member of and the 2002 LISA Conference... these are all EXCELLENT organizations and events which are of the highest quality and the absolute best there is for UNIX admins. who take their job seriously.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0


<< BTW, LISA is THE BEST CONFERENCE there is... and I have been to quite a few.. >>



DEFCON BABY! :p

SAGE and USENIX are pretty cool. I just never got around to signing up (much like ieee or whatever)