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

Configure Health Check Interval #771

Closed
Zaxim opened this issue Apr 5, 2019 · 4 comments
Closed

Configure Health Check Interval #771

Zaxim opened this issue Apr 5, 2019 · 4 comments

Comments

@Zaxim
Copy link

Zaxim commented Apr 5, 2019

Is your feature request related to a problem? Please describe.
When I start a haugene/transmission-openvpn it remains in a (health: starting) STATUS for 5 minutes, until the first health check triggers. Because the STATUS is not (healthy) my traefik reverse proxy will not create routes to the backend and the container is not accessible for 5 minutes.

Describe the solution you'd like

I would like to be able to configure how often the health check is performed, as opposed to the currently hard-coded 5 minutes. I could potentially shorten it to 2 minutes with no ill-effect and my container would be accessible sooner.

This could also be used be people who want to decrease the frequency of the health check, without disabling it completely.

Describe alternatives you've considered

A specific fix to my problem would be to force the health check to attempt immediately after the transmission scripts complete, as opposed to waiting to the scheduled time (I presume you're using cron).

@gdlx
Copy link

gdlx commented Jul 21, 2019

@Zaxim Did you find a workaround ? I thought some Traefik label would allow to ignor the container is starting but I don't find any...

@Zaxim
Copy link
Author

Zaxim commented Jul 22, 2019

Unfortunately, I have not found a workaround but I haven't dug too deeply into it since I opened the issue.

@gdlx
Copy link

gdlx commented Jul 22, 2019

I've found one actually, not on the traefik side, but just in the docker run command, by using --health-interval and --health-start-period to override Dockerfile config.

I've set --health-interval to 5s and --health-start-period to 10s, which makes the container available after 15 seconds. It works fine in my case but it may require tuning depending on configuration and connection speed.

5 minutes by default seems way too much IMO anyway (is there any healthy case where the VPN takes 5 minutes to be up ?). Maybe there's a good reason I don't know, but it's finally really easy to override anyway.

@haugene
Copy link
Owner

haugene commented Nov 3, 2019

Closing this with the solution proposed by @gdlx and adding a link to the documentation for this in the Docker Engine: https://docs.docker.com/engine/reference/run/#healthcheck

I do agree though, that 5 minutes is too long. We didn't think of the Traefik-usecase when we set it up. The reason for adding the healthcheck was to detect when the container lost connection to the internet (which apparently happens for some providers/hosts) and then being able to flag it so the the container could be restarted.

Maybe we'll change it going forward - but for now the Traefikers just need to override it.

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

3 participants