Victoriametrics: Shutdown delay for VM components

Created on 7 May 2020  路  2Comments  路  Source: VictoriaMetrics/VictoriaMetrics

Many load balancers, such as haproxy, can perform http-checks for determining backend liveness. VM components has /health handler, which is suitable for such healthchecks. Those checks performing with some frequency, every 5 seconds for example.
When restarting VM, it shuts down almost immediately, so the problem is that part of client requests via LB (load balancer) (prometheus > vminsert, grafana > vmselect, etc.) getting errors between LB health checks, because LB doesn't know that backend dead yet, and still trying to forward requests to it.

This can be fixed by adding shutdown delay to VM components: when application getting shutdown signal (SIGINT), it must be able to continue perform requests from clients as normally for some time, but shuts down /health handler, so LB with next check will mark this upstream as dead, and just stop to forward requests to it. This delay must be specified by command line option.

Similarly done in promxy with --http.shutdown-delay= option.

enhancement

Most helpful comment

Added -http.shutdownDelay option in the commit 099e44005b3a68d5ea7db68438caeccb4a46c177 . This commit will be included in the next release.

All 2 comments

Added -http.shutdownDelay option in the commit 099e44005b3a68d5ea7db68438caeccb4a46c177 . This commit will be included in the next release.

The -http.shutdownDelay flag has been added in v1.35.3 release. Closing this feature request as done.

@wf1nder , feel free re-opening it if you feel the feature could be improved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

genericgithubuser picture genericgithubuser  路  4Comments

WilliamDahlen picture WilliamDahlen  路  3Comments

prdatur picture prdatur  路  3Comments

ozn0417 picture ozn0417  路  3Comments

valyala picture valyala  路  4Comments