0

I have two servers s1 and s2 and two apps a1 and a2. a1 and a2 are installed on s1 and share some files that are accessible via a mount on s2.

If a1 writes a file onto the s2 server and a2 the fetches this file from the remote s2 server, how does the cache on s1 and s2 aid this process?

The cache on s1 won't be able to completely satisfy the read request of a2, because someone could have changed the file on s2 in the mean while. Does s1 linux ask s2 linux if the file has been changed, since its last access? Or will the file always be retransfered over the network? So only the s2 cache can be of any help?

Franz Kafka
  • 237
  • 3
  • 12

1 Answers1

1

Presumably you mean an NFS mount? let us know if not as you failed to include this important detail.

Caching algorithms check to see if a file's changed since that file entered cache and dump the whole file when it detects it's changed.

As NFS is a file-level sharing system S2 in this scenario will update the file's date stamps once a file is closed and the any changes committed. Any other machine that may have cached that file will, when that file is requested, check if the stamps match those of the cached version and if they don't match will dump the cached version and re-get it, optionally entering cache with the new stamps.

Chopper3
  • 101,299
  • 9
  • 108
  • 239