2006-12-29 02:22:08

by howard chen

[permalink] [raw]
Subject: NFS has caching?

I have around 100 files, currently NFS shared among 5 servers, all
servers access the file quite frequently, e.g. 10 hits per second per
server.

I cannot afford to rync since i want the delay of write as small as
possible, e.g. less than 1 second.


I want to know, since the file will be accessed quite frequent, does
NFS has build-in caching functions that if files are not modified, it
will not try to fetch from the network?


Thanks.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2006-12-29 10:51:37

by Trond Myklebust

[permalink] [raw]
Subject: Re: NFS has caching?

On Fri, 2006-12-29 at 10:22 +0800, howard chen wrote:
> I have around 100 files, currently NFS shared among 5 servers, all
> servers access the file quite frequently, e.g. 10 hits per second per
> server.
>
> I cannot afford to rync since i want the delay of write as small as
> possible, e.g. less than 1 second.
>
>
> I want to know, since the file will be accessed quite frequent, does
> NFS has build-in caching functions that if files are not modified, it
> will not try to fetch from the network?

Short answer: yes.

Long answer: http://nfs.sourceforge.net/#faq_a8

Trond


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-12-29 15:12:55

by howard chen

[permalink] [raw]
Subject: Re: NFS has caching?

On 12/29/06, Trond Myklebust <[email protected]> wrote:
> On Fri, 2006-12-29 at 10:22 +0800, howard chen wrote:
> > I have around 100 files, currently NFS shared among 5 servers, all
> > servers access the file quite frequently, e.g. 10 hits per second per
> > server.
> >
> > I cannot afford to rync since i want the delay of write as small as
> > possible, e.g. less than 1 second.
> >
> >
> > I want to know, since the file will be accessed quite frequent, does
> > NFS has build-in caching functions that if files are not modified, it
> > will not try to fetch from the network?
>
> Short answer: yes.
>
> Long answer: http://nfs.sourceforge.net/#faq_a8
>
> Trond
>
>

short questions:

1. are they enabled by default in Linux?

2. is it possible to config. the cache size? for example, i have 100GB
files in NFS, sometimes i want the client to cache as much as
possible, while sometimes i want to limit the disk space usage, say to
1GB cache.

Thanks.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-01-03 00:49:09

by Trond Myklebust

[permalink] [raw]
Subject: Re: NFS has caching?

On Fri, 2006-12-29 at 23:12 +0800, howard chen wrote:

> short questions:
>
> 1. are they enabled by default in Linux?

It is impossible to turn off caching.

> 2. is it possible to config. the cache size? for example, i have 100GB
> files in NFS, sometimes i want the client to cache as much as
> possible, while sometimes i want to limit the disk space usage, say to
> 1GB cache.

No you don't. Memory is managed by the kernel, not by userspace.

If the memory is not needed for other tasks, then it will cache whatever
filesystem data it held previously. If the memory is needed for other
tasks, then the kernel will reclaim it from the page cache.
You do have a few knobs for tweaking that reclaim algorithm
in /proc/sys/vm (see /usr/src/linux/Documentation/filesystems/proc.txt)
but you cannot use that to limit the cache size.

Trond


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-01-03 02:28:56

by howard chen

[permalink] [raw]
Subject: Re: NFS has caching?

On 1/3/07, Trond Myklebust <[email protected]> wrote:
> On Fri, 2006-12-29 at 23:12 +0800, howard chen wrote:
>
> > short questions:
> >
> > 1. are they enabled by default in Linux?
>
> It is impossible to turn off caching.
>
> > 2. is it possible to config. the cache size? for example, i have 100GB
> > files in NFS, sometimes i want the client to cache as much as
> > possible, while sometimes i want to limit the disk space usage, say to
> > 1GB cache.
>
> No you don't. Memory is managed by the kernel, not by userspace.
>
> If the memory is not needed for other tasks, then it will cache whatever
> filesystem data it held previously. If the memory is needed for other
> tasks, then the kernel will reclaim it from the page cache.
> You do have a few knobs for tweaking that reclaim algorithm
> in /proc/sys/vm (see /usr/src/linux/Documentation/filesystems/proc.txt)
> but you cannot use that to limit the cache size.
>
> Trond
>
>

so it that mean cacheing is done by the FS, nothing can be done on NFS
to improve the performance?

thanks...

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs