Vultr Load Balancer efficiently distributes incoming traffic across multiple servers, ensuring balanced resource utilization and enhanced reliability. This service prevents individual servers from becoming overloaded by managing traffic evenly, which helps maintain application performance and uptime. By provisioning a Load Balancer, you can enhance the scalability and resilience of your applications, improving overall user experience.
Follow this guide to provision a Vultr Load Balancer on your Vultr account using the Vultr Customer Portal, API, or CLI.
Navigate to Products and click Load Balancer.
Click Add Load Balancer.
Choose a Load Balancer Location.
Provide a Label, select an **Algorithm, provide Timeout time and select number of Nodes. By default the algorithm is set to Round Robin.
Configure Forwarding Rules.
Optional: Select a VPC Network. By default the VPC network is set to Public.
Optional: Configure any Firewall rules.
Configure any Health Checks.
Click Add Load Balancer.
Send a POST
request to the Create Load Balancer endpoint to create a Load Balancer.
$ curl "https://api.vultr.com/v2/load-balancers" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"region" : "ewr",
"balancing_algorithm" : "roundrobin",
"ssl_redirect" : false,
"http2": false,
"http3": false,
"proxy_protocol" : false,
"timeout" : 600,
"label" : "Example Load Balancer",
"nodes" : 1,
"health_check" : {
"protocol" : "http",
"port" : 80,
"path" : "/health",
"check_interval" : 10,
"response_timeout" : 5,
"unhealthy_threshold" : 3,
"healthy_threshold" : 3
},
"forwarding_rules": [
{
"frontend_protocol" : "http",
"frontend_port" : 80,
"backend_protocol" : "http",
"backend_port" : 80
}
],
"firewall_rules": [
{
"port" : 80,
"source" : "0.0.0.0/0",
"ip_type" : "v4"
}
],
"auto_ssl": {
"domain_zone" : "<example.com>",
"domain_sub" : "sub"
}
}'
Visit the Create Load Balancer page to view additional attributes you can add to your request.
Send a GET
request to the List Load Balancer endpoint to list all the available Load Balancers.
$ curl "https://api.vultr.com/v2/load-balancers" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Create a Load Balancer.
$ vultr-cli load-balancer create \
--region="ewr" \
--balancing-algorithm="roundrobin" \
--ssl-redirect=false \
--proxy-protocol=false \
--response-timeout=5 \
--label="Example Load Balancer" \
--protocol="http" \
--port=80 \
--path="/health" \
--check-interval=10 \
--healthy-threshold=3 \
--unhealthy-threshold=3 \
--forwarding-rules="frontend_protocol:http,frontend_port:80,backend_protocol:http,backend_port:80" \
--firewall-rules="port:80,ip_type:v4,source:0.0.0.0/0"
Run vultr-cli load-balancer create create --help
to view additional options you can apply on your instance.
List all the available Load Balancers.
$ vultr-cli load-balancer list