Skip to content
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

Huge CPU load #23

Open
msa7 opened this issue Mar 24, 2018 · 7 comments
Open

Huge CPU load #23

msa7 opened this issue Mar 24, 2018 · 7 comments

Comments

@msa7
Copy link
Contributor

msa7 commented Mar 24, 2018

Thanks for the useful shard.

I run three Sentry, each in the docker container.

  1. Watch JS, CSS to rebuild
  2. Watch CR, ECR to restart the web server
  3. Watch CR, ECR to rerun specs

I have huge CPU load
2018-03-24_06-21-55

Maybe Senty should use kqueue or similar, like rerun gem?

@samueleaton
Copy link
Owner

thanks for the feedback. I will investigate this.

Just to verify, does running your containers without sentry drastically reduce the hyperkit cpu?

@msa7
Copy link
Contributor Author

msa7 commented Mar 26, 2018

does running your containers without sentry drastically reduce the hyperkit cpu?

yes

I found a workaround. Run sentry on Mac. On file change rerun docker container, like this:

bin/sentry \
-w "./src/**/*.cr" -w "./src/**/*.ecr" \
-b "" -r "docker-compose" --run-args "run --rm test crystal spec --debug"

Please also consider #25

@samueleaton
Copy link
Owner

so sentry is not a cpu hog when being run directly on the host? its only when running in docker?

@samueleaton
Copy link
Owner

What is the processor and ram on your Mac? I am running a few sentries locally and hyperkit is staying below 20% (usually bellow 10%).

@KCErb
Copy link

KCErb commented May 24, 2019

I'm having the same issue, getting 300%+ (4 cores) with sentry running in the container. (lucky framework uses sentry for watch).

Related: docker/for-mac#1094

Though for me a factory reset doesn't solve the problem.

To answer your question to msa7:

MacBook Pro (Retina, 15-inch, Mid 2014)
2.5 GHz Intel Core i7
16 GB 1600 MHz DDR3

Docker has access to:
4 CPUs
6 GiB of Memory
1 GiB of Swap

I suppose I could increase the Swap? For now planning on running watch from host and triggering a recompile in the container from there like msa7.

@KCErb
Copy link

KCErb commented May 25, 2019

OK a few notes:

  1. I thought I was using Sentry, but Lucky has its own Sentry .. so sorry, I wasn't directly working with your library.
  2. All of the watch libraries are relying on similar principles which docker for mac really struggles with. At the end of the day, there are filesystem issues that I'm not qualified to speak on. A loop asking for file info (like modified timestamps) is going to be bad in docker for mac until they fix it.
  3. I solved my problems with docker-sync. I'll be doing a blog write up on this eventually, if there is any interest out there, I'll post a link to it here when it is written.

@samueleaton
Copy link
Owner

@KCErb yes please let me know what you find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants