NBCUTechnology / pubstack

⛔️ [DEPRECATED] Publisher's DevStack
MIT License
8 stars 8 forks source link

Set NFS mount to only cache files for a max of 1 second. #165

Closed ElijahLynn closed 9 years ago

cweagans commented 9 years ago

Tested this on a Mac host, and it totally makes sense. :+1: from me.

scottrigby commented 9 years ago

I agree, and want to merge this - but first I think we should allow "power users" to optionally bump the max time again, in case they have a good reason for doing so

cweagans commented 9 years ago

A config option seems like a good idea, yeah.

scottrigby commented 9 years ago

@cweagans ha what would the default be? I was trying to look and found on http://linux.die.net/man/5/nfs:

For NFS over TCP the default timeo value is 600 (60 seconds)

if that's true we could do:

diff --git a/Vagrantfile b/Vagrantfile
index 7a0ef81..2e658bf 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -69,9 +69,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
     # the path on the host to the actual folder. The second argument is
     # the path on the guest to mount the folder. And the optional third
     # argument is a set of non-required options.
+    actimeo = pubstack_config.include? 'actimeo' ? pubstack_config['actimeo'] : 60
     dev.vm.synced_folder pubstack_config['synced_folder'], '/var/www/html',
       type: synced_folder_type,
-      mount_options: ['rw', 'vers=3', 'tcp', 'fsc']
+      mount_options: ['rw', 'vers=3', 'tcp', 'fsc', 'actimeo=' + actimeo]

     # Provider-specific configuration for VirtualBox:
     dev.vm.provider 'virtualbox' do |vb|
cweagans commented 9 years ago

I think the default should be 1. There's no reason to have it higher unless you're testing something specific to how NFS caches files or something.

scottrigby commented 9 years ago

Yeah I personally agree… I was just being conservative about the change. In fact, needing to change that would be so rare, if someone is testing caching then they can edit the Vagrant file manually :wink:

scottrigby commented 9 years ago

I'm just gonna merge & if we find a problem for some reason down the line we can add this config in :+1:

ericduran commented 9 years ago

Isn't this going to make it extremely slow?

cweagans commented 9 years ago

Not so far!