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
Quiet down healthchecks to save battery and CPU usage, fixes #1663 #1674
Conversation
This is close, but |
60d32d4
to
6b6a654
Compare
6b6a654
to
c4909ae
Compare
Artifacts for this round are at https://circleci.com/gh/drud/ddev/15097#artifacts/containers/0 for anybody who would like to take a look. |
c4ece9b
to
d568df1
Compare
@j6s reviewed and ccommented in #1663 (comment) |
One minor question (not sure how this project handles configuration): Would it maybe make sense to pass the sleep time down via environment variable? That way we could have something like
in the dockerfile |
I think it's absolutely worth making that configurable, thanks. I thought about it as the work went on, but just wanted to prove the concept at the time, and never got back. I'll try to add a global config for that setup if this flies with everybody. |
The Problem/Issue/Bug:
#1663 complains about the constant running of the ddev-ssh-agent healthcheck, which uses CPU and battery. But really most of the containers have this problem, and with the other ones it multiplies.
Docker provides us only the "interval" configuration for healthcheck, which is both the time to wait before the first healthcheck and how often to run it after that.
In ddev, we mostly care about when it first becomes ready and usable, and it doesn't often need to be checked after that, but we were always stymied by Docker's design mistake here.
How this PR Solves The Problem:
This is admittedly a hacky approach, but
Manual Testing Instructions:
ddev stop -a --stop-ssh-agent
andddev start
Look at your computer's CPU usage.
Look at
docker events
, you should see far less than previously.An interesting tool is
docker inspect ddev-router | jq ".[].State.Health"
, which shows the last few healthchecks and their result (change container name as necessary). This is particularly interesting early in the life of a container.Automated Testing Overview:
None provided.
Related Issue Link(s):
OP #1663
Release/Deployment notes: