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

health check with higher rate during start_period #10461

Open
disk91 opened this issue Apr 12, 2023 · 5 comments
Open

health check with higher rate during start_period #10461

disk91 opened this issue Apr 12, 2023 · 5 comments

Comments

@disk91
Copy link

disk91 commented Apr 12, 2023

Description

When checking the health_check to create a dependency on container start you want to have a high rate check (like every second) to start the service as soon as possible. But once the containers are started you don't want to overload your service with health_checks.

Without this proposal, you need to wait interval time to discover your container is healthy and start the dependent containers even if the service was healthy a few seconds after being up.

I propose to have a new parameter like start_interval to override the interval period during the start_period.
Let take this config exemple:

  db:
    health check:
	test: ...
	   interval: 30s
	   timeout: 3s
           retry:2
	   start_period: 20s
           start_interval: 1s

This will perform a health check on every 1s during the start_period (from start to healthy stat, retry limit is ignored), then perform health check on every 30s with timeout & retry applied.

This is for reducing the downtime during stack restart and avoid to overload the health test after being started.

@disk91 disk91 changed the title healtcheck with higher rate during start_period health check with higher rate during start_period Apr 12, 2023
@milas
Copy link
Member

milas commented Apr 12, 2023

This sounds like a nice improvement! Compose's health check support is actually a wrapper around the functionality in Docker Engine, so this would need to exist there before Compose can support it.

I would open a feature request at https://github.com/moby/moby - if/when it's included in an Engine release, we can look at extending <svc>.healthcheck in YAML accordingly.

@milas milas closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2023
@nedsociety
Copy link

With --start-interval now available could you reopen the issue? Or should it be remade?

@thaJeztah
Copy link
Member

Might as well re-open this one 👍

Next step would probably be a change in the compose-spec; there's a tracking issue in moby;

And a pending PR in the compose-spec (which has to be included in compose once that's accepted/merged);

@thaJeztah thaJeztah reopened this Jul 11, 2023
@glours
Copy link
Contributor

glours commented Jul 11, 2023

Thanks @thaJeztah 👍

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

No branches or pull requests

5 participants