Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Performance issue when using shared folders, vbox guest additions, and node's forever --watch or nodemon on running image. #631

Open
johnpancoast opened this issue Nov 16, 2014 · 10 comments
Labels
question Usability question, not directly related to an error with Boot2Docker

Comments

@johnpancoast
Copy link

Docker noob here.

When developing node apps it seems common to use forever --watch or nodemon to watch for changes in particular directories and restart node when it finds changes. This speeds up development.

When I use either forever or nodemon as my CMD to start my node app forever --watch app.js, CPU for VBoxHeadless goes to 250%. This only happens when I use these tools and docker. Starting my app without them node app.js works fine. Using forever or nodemon on my host machine works fine.

The problem exists with both forever and nodemon so I suspect it's not them and something related to boot2docker, docker, or the share but I'm really not sure. I've seen a ton of posts related to this but I'm not sure if I'm missing something or not.

Can you shed some light on if this is a known bug/limitation and if there are workarounds?

@johnpancoast johnpancoast changed the title Performance issue when using shared folders and node's forever --watch or nodemon on running image. Performance issue when using shared folders, vbox guest additions, and node's forever --watch or nodemon on running image. Nov 16, 2014
@johnpancoast
Copy link
Author

Likely also related to #593

@johnpancoast
Copy link
Author

EDIT: After looking into this, the same problem exists when using either the samba share or vbox guest additions methods suggested below. Both raise VboxHeadless CPU to >200%.

Following the first suggestion here seemed to be better for me.

I'll check it out more soon to verify that works.

@johnpancoast
Copy link
Author

It's specifically grunt watch that's the issue in my case. Still thinking it's some kind of perf issue related to the share.

@tianon
Copy link
Contributor

tianon commented Nov 26, 2014

That sounds like it's likely related to vboxsf.

@thaJeztah
Copy link

If I understand correctly, grunt watch uses inotify to check for changes, but vboxsf doesn't support this (https://www.virtualbox.org/ticket/10660?cversion=0&cnum_hist=1). So possibly grunt will have to scan all files to check for modifications?

@johnpancoast
Copy link
Author

Interesting. Thanks. I've noticed after some reading that this is a known (and commonly understood) limitation of vboxsf.

Are there workarounds, other options, or potential features/fixes on your side related to this?

@thaJeztah
Copy link

I think it's best to search in the other issues about this topic. Depending on your situation, there may be some workarounds, but not sure.

In my personal setup (but this is beyond the scope of boot2docker), I don't use a shared folder, but have a SSHD helper-container and let my IDE sync changes to the container over SSH. The downside of course is having the source in two locations, but performance-wise it just works a lot better.

@kimpellikaan
Copy link

@shideon I faced the exact same problem so started comparing all options (nodemon, forever, grunt). For me grunt-develop with livereload works like a charm. Maybe that can help.

@johnpancoast
Copy link
Author

@kimpellikaan thanks! I'll check it out.

@wglambert wglambert added the question Usability question, not directly related to an error with Boot2Docker label Jun 25, 2018
@marxangels
Copy link

Why does nodemon not work for me? It's not a slow problem, it's totally ineffective, file changes did not trigger a restart.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Usability question, not directly related to an error with Boot2Docker
Projects
None yet
Development

No branches or pull requests

6 participants