Skip to content

Instantly share code, notes, and snippets.

@lerouxb
Created December 4, 2014 09:16
Show Gist options
  • Select an option

  • Save lerouxb/e3719764b2b4c6ae990e to your computer and use it in GitHub Desktop.

Select an option

Save lerouxb/e3719764b2b4c6ae990e to your computer and use it in GitHub Desktop.
best vagrant performance I've managed to get so far

This is with an Ubuntu guest on a OSX host. I noticed that some tools just notice changed files faster than others and generally you have to enable "compatibility" flags so it uses the slowest, most reliable method. But often then it might notice multiple changes in a loop, so make sure your system date/time is synced very accurately on both the guest and the host and you still might have to throttle or debounce those reloads. Watcher processes/tools typically support that sort of thing through command-line options.

To speed up syncing and I/O in general

Somewhere in Vagrantfile:

config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['actimeo=2', 'rw', 'vers=3', 'tcp', 'fsc']

Install cachefilesd:

http://chase-seibert.github.io/blog/2014/03/09/vagrant-cachefilesd.html

To speed up a node.js app's (re)start time

I just did some very coarse-grained performance logging to see where all the time goes when dev servers and things restart and then moved things around so that the server at least starts up quickly and starts listening to requests.

When the slower require() calls are only encountered for the first time as things go down certain routes, then that just causes that first request to feel slower because require() is synchronous, so it won't drop that request or something like that.

At least then things restart faster and they don't slow your system down as much because you often get multiple restarts in a row as you work on things, so in development easily more restarts than actual page views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment