qdm12 / gluetun

VPN client in a thin Docker container for multiple VPN providers, written in Go, and using OpenVPN or Wireguard, DNS over TLS, with a few proxy servers built-in.
https://hub.docker.com/r/qmcgaw/gluetun
MIT License
6.69k stars 330 forks source link

feat: add ability to configure the amount of times the healthcheck fails #2272

Open cdloh opened 1 month ago

cdloh commented 1 month ago

Adds the ability to configure the amount of times that the healthcheck can fail before the system will restart the VPN

Context

My internet gets a bit flaky when it's maxed out attempting to put traffic through the VPN. There's nothing actually wrong with the connection and traffic is flowing fine but the healthcheck times out or refuses to connect every so often.

This then causes the VPN to flap and restart and then connect again and get stuck in a loop.

This change allows the healthcheck to attempt a few more times. I've been running this for a while and it solves my issue and keeps the connection healthy.

If you're happy with this feature I'm happy to clean it up a bit more and update the wiki as required.

cdloh commented 1 month ago

Looks like you pushed some healthcheck changes in latest. I'll test to see if it largely solves my issues and discard this if it does 👍

qdm12 commented 1 month ago

Adds the ability to configure the amount of times that the healthcheck can fail before the system will restart the VPN

Why not just increase HEALTH_VPN_DURATION_INITIAL?

Looks like you pushed some healthcheck changes in latest. I'll test to see if it largely solves my issues and discard this if it does

Indeed, sorry maybe I missed your PR before. The change might help, it essentially increases the dialing timeout on every try (instead of fixed 3 seconds), and the health initial vpn duration was increased as well.

I don't think the number of attempts adds much value, although it could replace the existing timer (but retro-compatibility, so we're stuck until v4). Now feel free to discuss ideas etc. to improve it as well!