Huge CPU load
Thanks for the useful shard.
I run three Sentry, each in the docker container.
- Watch JS, CSS to rebuild
- Watch CR, ECR to restart the web server
- Watch CR, ECR to rerun specs
I have huge CPU load

Maybe Senty should use kqueue or similar, like rerun gem?
thanks for the feedback. I will investigate this.
Just to verify, does running your containers without sentry drastically reduce the hyperkit cpu?
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 https://github.com/samueleaton/sentry/pull/25
so sentry is not a cpu hog when being run directly on the host? its only when running in docker?
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%).
I'm having the same issue, getting 300%+ (4 cores) with sentry running in the container. (lucky framework uses sentry for watch).
Related: https://github.com/docker/for-mac/issues/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.
OK a few notes:
- I thought I was using Sentry, but Lucky has its own Sentry .. so sorry, I wasn't directly working with your library.
- 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
modifiedtimestamps) is going to be bad in docker for mac until they fix it. - 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.
@KCErb yes please let me know what you find.