A monitoring feature that verifies your backend servers are operational by periodically testing their response to HTTP, HTTPS, or TCP requests.
Health Checks on a Vultr Load Balancer monitor the status of your backend servers by periodically sending requests to them. These checks assess whether a server is healthy and responsive, enabling the Load Balancer to route traffic only to servers that are functioning correctly. By configuring health checks, you ensure that traffic is directed away from servers experiencing issues, maintaining the reliability and performance of your application.
Follow this guide to manage the health checks on a Vultr Load Balancer using the Vultr Customer Portal, API, CLI, or Terraform.
Send a GET
request to the List Load Balancers endpoint and note the target Load Balancer's ID.
$ curl "https://api.vultr.com/v2/load-balancers" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a PATCH
request to the Update Load Balancer endpoint to update the target Load Balancer's health checks configuration.
$ curl "https://api.vultr.com/v2/load-balancers/{load-balancer-id}" \
-X PATCH \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"health_check" : {
"protocol" : "{http_or_https_or_tcp}",
"port" : {port},
"path" : "{path}",
"check_interval" : {interval_in_seconds},
"response_timeout" : {timeout_in_seconds},
"unhealthy_threshold" : {unhealthy_threshold},
"healthy_threshold" : {healthy_threshold}
}
}'
Send a GET
request to the Get Load Balancer endpoint to fetch the details of the target Load Balancer.
$ curl "https://api.vultr.com/v2/load-balancers/{load-balancer-id}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
List all available instances and note the target Load Balancer's ID.
$ vultr-cli load-balancer list
Update the target Load Balancer's health checks configuration.
$ vultr-cli load-balancer update <load-balancer-id> \
--protocol "<http_or_https_or_tcp>" \
--port {port} \
--path "{path}" \
--check-interval <interval_in_seconds> \
--response-timeout <timeout_in_seconds> \
--healthy-threshold <healthy_threshold> \
--unhealthy-threshold <unhealthy_threshold>
Get the details of the target Load Balancer.
$ vultr-cli load-balancer get <load-balancer-id>
Open your Terraform configuration for the existing Load Balancer.
Add or update the health_check
block to define probe protocol, port, path, and thresholds, then apply.
resource "vultr_load_balancer" "lb" {
# ...existing fields (region, label, forwarding_rules, etc.)
health_check {
path = "/health"
port = 8080
protocol = "http"
response_timeout = 3
unhealthy_threshold = 2
check_interval = 10
healthy_threshold = 3
}
}
Apply the configuration and observe the following output:
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
No comments yet.