8000 chore: Reduce Docker healthcheck interval by charithe · Pull Request #1978 · cerbos/cerbos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: Reduce Docker healthcheck interval #1978

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

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

charithe
Copy link
Contributor
@charithe charithe commented Feb 7, 2024

In Docker Compose, the helathcheck interval can add an artificial delay
because it waits for the first healthcheck to run.

Signed-off-by: Charith Ellawala charith@cerbos.dev

In Docker Compose, the helathcheck interval can add an artificial delay
because it waits for the first healthcheck to run.

Signed-off-by: Charith Ellawala <charith@cerbos.dev>
@charithe charithe merged commit 4798453 into cerbos:main Feb 7, 2024
@charithe charithe deleted the docker-timeout branch February 7, 2024 08:56
@@ -7,7 +7,7 @@ ENV CERBOS_CONFIG="__default__"
VOLUME ["/policies", "/tmp", "/.cache"]
ENTRYPOINT ["/cerbos"]
CMD ["server"]
HEALTHCHECK --interval=1m --timeout=3s CMD ["/cerbos", "healthcheck"]
HEALTHCHECK --interval=10s --timeout=2s --retries=2 --start-period=5s CMD ["/cerbos", "healthcheck"]
Copy link
Member
@haines haines Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think start period < interval makes sense?

start period provides initialization time for containers that need time to bootstrap. Probe failure during that period will not be counted towards the maximum number of retries

If the interval is greater than the start period, then there won't be any probes to fail anyway.

I think we want to set something like --start-interval=1s as well so that we can detect when Cerbos is ready before the first regular probe.

start interval is the time between health checks during the start period.

edit: actually the start interval defaults to 5s so my reasoning here is probably not completely sound, but I still think it makes sense to reduce it since Cerbos typically starts up very quickly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point about --start-period. The reason I did 7F99 n't include --start-interval is because it was only introduced in Docker Engine 25.0 which was only just released. I think it'd take a little while for people to upgrade.

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

Successfully merging this pull request may close these issues.

3 participants
0