How to Manage Health Checks for Vultr Load Balancer

Updated on November 27, 2024

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.

  • Vultr Customer Portal
  • Vultr API
  • Vultr CLI
  1. Navigate to Products and click Load Balancer.

    Load Balancer option in products menu

  2. Click your target Load Balancer to open its management page.

    Selection of a target Load Balancer

  3. Click Configuration.

    Button to open Load Balancer configuration window

  4. Click Health Checks.

    Button to open Health Checks window

  5. Configure Health Checks by providing Protocol, Port, Interval between health checks, Response timeout, Unhealthy Threshold, Healthy Threshold and HTTP Path.

    Fields to configure Health Checks for the Load Balancer

  6. Click Save Changes.

    Button to save Load Balancer health check changes

  1. Send a GET request to the List Load Balancer endpoint and note the target Load Balancer's ID.

    console
    $ curl "https://api.vultr.com/v2/load-balancers" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  2. Send a PATCH request to the Update Load Balancer endpoint to change the target Load Balancer's health checks.

    console
    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
            }
    }'
    
  1. List the available Load Balancers and note the target Load Balancer's ID.

    console
    $ vultr-cli load-balancer list
    
  2. Update the health checks for the target Load Balancer.

    console
    $ 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