Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Add docs on how to improve performance by mixing synced folder types #1259

Merged
merged 3 commits into from
Apr 14, 2017

Conversation

oxyc
Copy link
Collaborator

@oxyc oxyc commented Mar 24, 2017

See #1242 (comment).

How's that? Or maybe under the synced folder section as it's more a feature than a performance improvement suggestion

@geerlingguy
Copy link
Owner

This placement seems appropriate to me.

@geerlingguy
Copy link
Owner

Going to do a little testing before merging, though (I trust you, but I want to see how much of an impact this could make for poor forlorn Windows non-10 devs.

@oxyc
Copy link
Collaborator Author

oxyc commented Mar 25, 2017

Don't merge just yet btw, I'll test this too and probably change this and the example above to use drupal-project structure drupal/web rather than drupal/public so it's easier for people to understand / copy-paste.

@oxyc
Copy link
Collaborator Author

oxyc commented Mar 25, 2017

So it didn't work :) It seems that since we updated the examples to use local_path: . the excluded_path examples have been incorrect. You cant reference a parent directory in the path.

@oxyc
Copy link
Collaborator Author

oxyc commented Mar 25, 2017

These are the rsync executions

rsync --verbose --archive --delete -z --chmod=ugo=rwX --no-owner --no-group \
--rsync-path ".........." \
--exclude ".vagrant/" \
--exclude "private" \
--exclude ".git" \
--exclude "web/sites/default/files" \
--exclude "tmp" \
--exclude "config/drupal" \
/Users/cindy/Projects/Personal/drupal-vm/ vagrant@127.0.0.1:/var/www/drupal
find /var/www/drupal \
-path /var/www/drupal/private -prune \
-o -path /var/www/drupal/.git -prune \
-o -path /var/www/drupal/web/sites/default/files -prune \
-o -path /var/www/drupal/tmp -prune \
-o -path /var/www/drupal/config/drupal -prune \
-o '!' -type l -a '(' ! -user vagrant -or ! -group vagrant ')' \
-exec chown vagrant:vagrant '{}'

@geerlingguy
Copy link
Owner

I'm also investigating doing reverse shared folders (e.g. sync folder from guest to host, using sshfs or other options).

@yareckon
Copy link

Sharing guest to host is great for php performance on large codebases. We do it for some vagrant projects. I would suggest samba / smb as a protocol since all hosts have passable clients for it.

The drawbacks are:

  1. Not having access to the codebase when the VM is shut down (you can't check on something quick without waiting for it to boot)
  2. All the compatibility, configuration and performance problems move to the IDE / text editor, which now has to not choke on the "remote" codebase, or use inappropriate features on it like SASS compilation or git management.

@geerlingguy
Copy link
Owner

@yareckon - Especially "performance problems move to the IDE / text editor" — global find-and-replace is an especially slow performer.

@geerlingguy
Copy link
Owner

@oxyc - I'm okay with merging this as-is, if the way it's currently written works.

Maybe we could also add a link to the article Drupal VM on Windows - a fast container for BLT project development, which has some recommendations around reverse-mounting a Samba share, or using SSH sync like with PhpStorm?

2. **Use `smb` for the synced folder's type.**
2. **Use `rsync` for the synced folder's type.** This requires that you have `rsync` available on your Windows workstation, which you can get if you install a substitute CLI like [Cygwin](https://www.cygwin.com/) or [Cmder](http://cmder.net/).
1. **Use `smb` for the synced folder's type.**
1. **Use `rsync` for the synced folder's type.** This requires that you have `rsync` available on your Windows workstation, which you can get if you install a substitute CLI like [Cygwin](https://www.cygwin.com/) or [Cmder](http://cmder.net/).
Copy link
Collaborator Author

@oxyc oxyc Apr 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall a discussion somewhere where you preferred this way of numbering markdown lists?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah; it's easier to update them without renumbering stuff. Good catch!

@geerlingguy geerlingguy merged commit be8c68b into geerlingguy:master Apr 14, 2017
@oxyc oxyc deleted the issue-1258 branch April 24, 2017 16:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants