Health Checks on 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 for your Vultr Load Balancer on your Vultr account using the Vultr Customer Portal, API, or CLI.
Navigate to Products and click Load Balancer.
Click your target Load Balancer to open its management page.
Click Configuration.
Click Health Checks.
Configure Health Checks by providing Protocol, Port, Interval between health checks, Response timeout, Unhealthy Threshold, Healthy Threshold and HTTP Path.
Click Save Changes.
Send a GET
request to the List Load Balancer 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 change the target Load Balancer's health checks.
curl "https://api.vultr.com/v2/load-balancers/<loadbalancer-id>" \
-X PATCH \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"health_check": {
"protocol": "http",
"port": 80,
"path": "/health",
"check_interval": 10,
"response_timeout": 5,
"unhealthy_threshold": 3,
"healthy_threshold": 3
}
}'
List the available Load Balancers and note the target Load Balancer's ID.
$ vultr-cli load-balancer list
Update the health checks for the target Load Balancer.
$ vultr-cli load-balancer update <loadbalancer-id> \
--protocol="http" \
--port=80 \
--path="/health" \
--check-interval=10 \
--response-timeout=5 \
--unhealthy-threshold=3 \
--healthy-threshold=3