Vultr Load Balancer provides two traffic distribution algorithms: Least Connections, which directs traffic to the server with the fewest active connections, and Round Robin, which cycles traffic through servers in a sequential manner. These algorithms help manage how traffic is distributed based on server load or through a balanced approach. By choosing the appropriate algorithm, you can optimize traffic management according to your application’s needs.
Follow this guide to manage the algorithm 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 Load Balancer.
Click Algorithm and select an algorithm.
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 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": "leastconn"
}'
List the available Load Balancers and note the target Load Balancer's ID.
$ vultr-cli load-balancer list
Update the algorithm for the target Load Balancer.
$ vultr-cli load-balancer update <loadbalancer-id> --balancing-algorithm="leastconn"