-
Notifications
You must be signed in to change notification settings - Fork 622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable auto cache and disable compression on sshfs mounts #1605
Enable auto cache and disable compression on sshfs mounts #1605
Conversation
Signed-off-by: Jason McCallister <jason@craftcms.com>
Hi @jasonmccallister, thanks for this! You will need to update the tests:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm +1 with this. I don't see any regressions and looks like it should work on older versions of sshfs
& fuse
if users' instances has that. All we need is the 3 tests to be fixed and it's good to go.
Thank you! I’ll update these tests tomorrow, apologies for the delay! |
Still have a failing test:
|
@townsend2010 I just pushed another commit. Unfortunately I can't compile this locally on macOS, so I need to use Travis :) |
Ugh, now As an aside, it's possible to build Multipass inside a Multipass instance, just allocate enough CPU's and memory and it builds just fine. |
Fixed that :) |
Codecov Report
@@ Coverage Diff @@
## master #1605 +/- ##
==========================================
+ Coverage 73.79% 75.45% +1.66%
==========================================
Files 223 223
Lines 8163 8263 +100
==========================================
+ Hits 6024 6235 +211
+ Misses 2139 2028 -111
Continue to review full report at Codecov.
|
Thank you for stepping in and resolving those issues @Saviq! Is there a way to test a macOS build with this change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'm good with this.
bors try |
@jasonmccallister the macOS package got built here: e84fa46#comments |
tryBuild succeeded: |
Thanks @Saviq giving it a try now. If there are existing mounts, do they need to be readded or will updating multipass and restarting the machine suffice? |
Updating Multipass and restarting the instance is fine. |
Have you had a chance to try it out and if so, does this work better for your project? Thanks! |
@townsend2010 its better - still not perfect but results seem favorable in my testing - will talk to the team and get some additional feedback. |
@townsend2010 there is a minor improvement on the speeds - but we are still seeing issues. What would be the performance impact in disabling the cache altogether? I think it may cause more harm than good, but it might resolve our issues. Another idea we are considering is embedded a "watcher" in the virtual machine that will scan the directories for our needs. That seems to "force" sshfs to update its cache instantly. We do have some large files (PHP and Node dependency directories) that the watcher can ignore but wanted to get some thoughts for your team? |
Hey @jasonmccallister, I did some basic testing of disabling the cache via |
That makes sense, no caching I'm sure would have some impacts. What about setting the cache duration to 3 seconds? |
I set the cache duration to 3 seconds and saw an ~4% decrease in read speeds which to me is acceptable. I will put up a PR with this change and after the packages build, I'd like to ask you test to see if this improves things for you. Thanks! |
Both the Linux and Mac versions of my PR are available at #1654 (comment). Please let me know in that PR how it goes for you. Thanks! |
@townsend2010 I will give it a try right now. Thank you! |
@townsend2010 that is a huge improvement on my side, I will ask a few other team members to test and verify but that looks like it was the right combo! Thank you! |
That is awesome! To make sure I'm not missing something on performance under "normal" (whatever "normal" is 😄) conditions, I'll get some of my teammates to try out my PR as well. Thanks again! |
@townsend2010 feedback I've received from the community has been really positive with this change. Thank you! |
We're merging #1654 instead :) |
This is related to #1502
sshfs has a default cache duration of 20 seconds. Since multipass is a local virtual machine, it might make sense to disable compression (as we are less worried about the network traffic) and auto caching enables caching based on modification times.
Happy to discuss the options in further detail, but the default 20 second cache is rather noticeable in our project.