-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
Jets startup time is really long in local development with docker on MacOS #39
Comments
Thanks for the report. Took a gander at the Jets example project you’ve set up. Thanks for putting it together. It helps. 👍 This likely has to do with the fact that Jets uses Dir.glob a lot to do inflection and figure out what it needs to do. So Jets is reading a bunch of files on the filesystem. The performance issue then surfaces with Docker shared volumes on a macosx host. Looks like you’ve got a macosx host and are mounting a folder for the app code https://github.com/onnimonni/jets-project/blob/master/docker-compose.yml#L8 Have ran into slowness with Docker, macosx and shared volumes many times before 😞 Even ended up writing a rsync tool https://github.com/tongueroo/docksync to workaround the issue. Gut tells me that is the issue right off the bat though. Understand that the need the shared volume so that we can edit files locally and see changes immediately reflected on the Docker host. For a test to confirm the theory though, can you try removing the shared volumes and testing the performance speed without the shared volumes? Would like to confirm my gut thoughts. Would like to improve the performance here to be closer to Rails. Curious to see what happens. Have seen that as any app gets larger, the Docker volume on macosx becomes a problem because it takes time to load the app files themselves. There is no noticeable performance overhead with shared volumes when the host is Linux, only with MacOSX. Also have tried using Docker with NFS volumes instead and that helps but it wasn’t enough. Will tag this will help wanted. |
I've tried @onnimonni project setup on Debian Linux and got this:
@tongueroo can we use |
Thanks for helping out! The test from @pocheptsov seems to confirm that this is just caused from slow bind mounts in MacOS. My problem is that I have too many ruby projects with different version dependencies so using rbenv or locally installed ruby gets too time consuming. Also docker helps others to start working with the same project faster because the environments are well defined. I guess the biggest problem is the I will try this again with setup where those are moved away from the project folder. Edit: Rails has been slow too but adding the |
@pocheptsov Thank so much for testing the theory. It did not even occur to me that you might not be on a macosx machine when I asked you to take a look 🤦🏻♂️ Appreciate reproducing it on Linux. Ha, you noticed the JETS_TIMING code. That's some experimental code I hacked on to do some quick timing analysis. Unsure if it'll be kept around tbh. To turn it on run:
You'll get something like this at the end of the deploy:
The instrumentation has only been added to the build and deploy process. There's no instrumentation that measures the Jets booting process. Feel that Jets timing is pretty hacky and likely will remove it at some point. So it was actually better to go back to puts debugging to identify the performance issue. @onnimonni @pocheptsov TLDREssentially, added You can also set the AWS region explicitly with Test results
Fork of example jets-projectAlso if you're wondering how the issue was debugged. Here are the changes to the @onnimonni jets-project example:
This allowed testing with a local copy of jets with docker-compose and to identify the issue a little more quickly. 👍 |
Released in v0.8.18: CHANGELOG Thanks again for the helpful reporting. |
Excellent! and thanks for the fast fix! |
I'm seeing quite high waiting times (1m17s) before anything happens.
I'm running the latest jets gem (0.8.17) with ruby 2.5.1 and nodejs v10.11.0.
I shared my docker setup here: https://github.com/onnimonni/jets-project
Similar setup has been working really well for my rails projects.
These are the commands I used inside the docker container:
The text was updated successfully, but these errors were encountered: