Load Balancer
Distribute traffic across VM pools with health checks and SSL termination.
View Service DetailsThe platform load balancer distributes incoming connections across a pool of backend VMs, removes unhealthy backends automatically, and can terminate SSL so certificates are managed in one place instead of on every VM.
Modes
| Layer | Protocols | Features |
|---|---|---|
| Layer 4 | TCP / UDP | Highest throughput; connection-level balancing for databases, mail, custom protocols |
| Layer 7 | HTTP / HTTPS | SSL termination, host- and path-based routing, session persistence (cookie), WebSocket support |
Setting Up an HTTPS Load Balancer
Create the load balancer
Networking → Load Balancers → Create. Choose internal (private VIP inside the VPC) or public (attached elastic IP).
Add a listener
Listener HTTPS :443. Upload your certificate and key, or select one already stored in the certificate manager.
Define the backend pool
Add your web VMs on port 8080 (or wherever the app listens). Choose an algorithm: round-robin, weighted, or least-connections.
Configure the health check
HTTP GET /healthz every 10 seconds, 3 failures to eject, 2 successes to restore. Unhealthy VMs stop receiving traffic automatically.
Session Persistence
For applications that keep session state in memory, enable cookie-based persistence so a client keeps hitting the same backend. Stateless applications should leave it off for the most even distribution.
# Create a load balancer via API
curl -X POST "https://api.daakyicloud.com/v1/load-balancers" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"name": "web-lb",
"vpc_id": "vpc-9d1c",
"scheme": "public",
"listeners": [{
"protocol": "https", "port": 443, "certificate_id": "cert-11aa",
"backend": {"port": 8080, "algorithm": "least_connections",
"health_check": {"path": "/healthz", "interval_s": 10}}
}]
}'Load balancer + two VMs with anti-affinity (kept on different hosts) is the standard minimum pattern for a service that stays up through host failure and rolling deployments.
