winnfsd / vagrant-winnfsd

Manage and adds support for NFS for Vagrant on Windows.
Other
567 stars 62 forks source link

Slow writing speed #74

Open amirbilu opened 8 years ago

amirbilu commented 8 years ago

First of all, let me start by saying that your project is amazing.

I know you're aware of the writing speed being quite slow comparing to VBOX shared folder. I was wondering if you know why this is happening, where is the bottleneck, and whether there are plans to improve this in the future ?

Thanks!

marcharding commented 8 years ago

Please take a look at https://github.com/winnfsd/winnfsd/issues/22

amirbilu commented 8 years ago

Thanks man. Sounds great! I'll be able to look at it only in a week. Will update.

Nightbr commented 7 years ago

Hey, I still have this issue... On linux, my application load in 800/600ms and on Windows it take 14000/6000ms :/ (no cache/with cache). Here my current configuration:

λ vboxmanage --version
5.1.10r112026
λ vagrant --version
Vagrant 1.9.1
λ vagrant plugin list
vagrant-docker-compose (1.2.0)
vagrant-gatling-rsync (0.9.0)
vagrant-hostmanager (1.8.5)
vagrant-hosts (2.8.0)
vagrant-share (1.1.6, system)
vagrant-vbguest (0.13.0)
vagrant-winnfsd (1.3.1)

config.vm.synced_folder "../my-website", "/var/www/website/current/", type: "nfs", :mount_options => ['rw,vers=3,tcp,nolock']

I tried other configuration (udp) but nothing changes...

Add to that I have changed the virtualBox network adapter to PCnet-FAST III (Am79C973) but no change...

It is a huge Symfony Application (with a lots of vendors...).

Any idea?

Thanks in advance!

marcharding commented 7 years ago

I have some larger symfony2 projects which load in about 2000ms.

Can you try using "virtio" instead of "Am79C973"?

The i/o speed of your pc is also an issue.

Nightbr commented 7 years ago

hey, thanks for your answer! here is a speed test of my hard-drive: image

Also, I made this script as a workaround (without this my page load in 56s Oo). It is due to the lots of I/O from cache and logs folder (and vendor, bower_components, node_modules when installing/updating dependencies).

#!/usr/bin/env bash

## Only problem: we can't debug vendor from host :/

## create dir for optimize mount bind
mkdir -p /home/vagrant/welp_tmp/
mkdir -p /home/vagrant/welp_tmp/node_modules
mkdir -p /home/vagrant/welp_tmp/vendor
mkdir -p /home/vagrant/welp_tmp/bower_components
mkdir -p /home/vagrant/welp_tmp/app
mkdir -p /home/vagrant/welp_tmp/app/cache
mkdir -p /home/vagrant/welp_tmp/app/logs
mkdir -p /home/vagrant/welp_tmp/uploads

chown -R vagrant:vagrant /home/vagrant/welp_tmp

## create dir for optimize mount bind
mkdir -p /var/www/welp/current/node_modules
mkdir -p /var/www/welp/current/vendor
mkdir -p /var/www/welp/current/bower_components
mkdir -p /var/www/welp/current/web/uploads

mount --bind /home/vagrant/welp_tmp/node_modules /var/www/welp/current/node_modules
mount --bind /home/vagrant/welp_tmp/vendor /var/www/welp/current/vendor
mount --bind /home/vagrant/welp_tmp/bower_components /var/www/welp/current/bower_components
mount --bind /home/vagrant/welp_tmp/app/cache /var/www/welp/current/app/cache
mount --bind /home/vagrant/welp_tmp/app/logs /var/www/welp/current/app/logs
mount --bind /home/vagrant/welp_tmp/app/logs /var/www/welp/current/web/uploads

I will try with "virtio" and let you know if it's better!

marcharding commented 7 years ago

Put the cache folder (and maybe the log folder too) in a ramdrive, e.g. sudo mount -t tmpfs -o size=256M none /home/vagrant/welp_tmp/app/cache.

That will result in a huge speed boost with no disadvantages.

Nightbr commented 7 years ago

Awesome! It works like a charm! You're my hero of the day ;) Thanks!

## Put cache and log in ram
mount -t tmpfs -o size=256M none /var/www/welp/current/app/cache
mount -t tmpfs -o size=128M none /var/www/welp/current/app/logs

After the cache is warmup my page loads in 900ms!! Add to that I have better perf with PCnet-FAST III (Am79C973) [-20~30ms]

lucabartoli commented 5 years ago

Placing here for future reference: Sometimes the real issue is that winnfsd is working on directories like C:/Users/....something. These directories are usually checked constantly by Windows Indexing service, so this is the perfect recipe for a massive performance issue. Our killer solution has been to completely disable the service (Go to services, find Windows Search, stop and disable it). Otherwise you can disable indexing for single folders. All the instructions here

We tried everything else, but this was the only one big thing to change... and load time went from 50s to 1s.