nlf / dhyve-os

a tiny OS for running docker in xhyve
194 stars 19 forks source link

A fix for file change detection in NFS #28

Open klenis opened 8 years ago

klenis commented 8 years ago

Hi!

This is related to dlite (v1 with NFS) and most likely future versions of dlite/dhyve-os since I've read that you are planning on moving back to NFS from 9P. Really looking forward to a future v2 of dlite with NFS since the performance of 9P is really terrible for my use cases.

The only standing issue that I've had with dlite is the annoying and frequent behavior that file updates are not synced between server and host unless you wait for 5-10 seconds.

After the finding this stack overflow question and including the actimeo=1 option in the mount command in the legacy branch everything seems to be working perfectly.

Is this something you would consider including in the upcoming NFS solution for v2?

nlf commented 8 years ago

sounds like a great idea to me

bpinto commented 8 years ago

@klenis I didn't notice any speed increase. Perhaps I added the wrong flag? Would you mind sharing what you did? Perhaps a PR?

This is what I did:

diff --git a/rootfs/etc/init.d/S41automount-nfs b/rootfs/etc/init.d/S41automount-nfs
index d237aa5..136f43c 100755
--- a/rootfs/etc/init.d/S41automount-nfs
+++ b/rootfs/etc/init.d/S41automount-nfs
@@ -20,7 +20,7 @@ start() {

   if [ -n "$gateway" ]; then
     mkdir -p "$share"
-    mount ${gateway}:"$share" "$share" -o rw,async,noatime,rsize=32768,wsize=32768,proto=tcp
+    mount ${gateway}:"$share" "$share" -o rw,async,noatime,rsize=32768,wsize=32768,proto=tcp,actimeo=1
     echo "OK"
   else
     echo "FAIL"