A load balancing algorithm determines how a Vultr Load Balancer distributes incoming traffic to linked instances. Vultr Load Balancers support the least connections and round robin algorithms that manage the distribution of traffic to instances depending on your application needs.
Follow this guide to manage load balancing algorithms on a Vultr Load Balancer 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 Load Balancer on the left navigation menu.
Click the Algorithm drop-down and select a load balancing algorithm from the list of options.
Click Save Changes to apply the load balancing algorithm.
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 update the target Load Balancer's algorithm.
$ curl "https://api.vultr.com/v2/load-balancers/<loadbalancer-id>" \
-X PATCH \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"balancing_algorithm": "<algorithm>"
}'
List all available instances and note the target Load Balancer's ID.
$ vultr-cli load-balancer list
Update the target Load Balancer's algorithm.
$ vultr-cli load-balancer update <loadbalancer-id> --balancing-algorithm="leastconn"