Performance problems in Vagrant when using host files into guest

I am working in an application that has to access a good number of resource files (good both in numbers and file sizes). As usual I am working in a Vagrant instance, and everything was going fine for the initial work.

But eventually the number of files passed from just testing to production, and while developing in my host the file access operation was ok (in the order of seconds to load everything), when the same code was running in Vagrant it took more than ten minutes to be ready.

At first I thought it was a memory problem, and increasing it to 6GB helped a bit (nine minutes instead of ten), it still didn’t cut.

I tried creating an instance in AWS, and surprising enough the performance was similar to running in my Mac.

I decided to copy all the files to the Vagrant instance, and then the problem was sorted, performance is on par with the host and AWS. That was it. Looking at the documentation, I noticed a shared directory option that is rsync, but I haven’t tried it, because I wrote a set of scripts that take care of preparing those resources to be deployed (both in Amazon and Vagrant) and dropping them on destination (which is a nice addition to my attempts to automate as much as I can both in development and deployment).

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Leave a Reply

Your email address will not be published. Required fields are marked *