LightYear
/Docs
DocsNetworkingSet Up a Load Balancer

Set Up a Load Balancer

Deploy a managed load balancer to distribute traffic across multiple backend servers.

intermediate
8 min read
LightYear Team
Updated April 24, 2026
load-balancernetworkinghascaling
Ready to get started?

Overview

LightYear Managed Load Balancers distribute incoming traffic across a pool of backend servers, providing high availability and horizontal scaling.

Step 1 — Create a Load Balancer

  1. Navigate to Network → Load Balancers → Create.
  2. Choose a region (must match your backend servers).
  3. Select a forwarding rule:
    • Frontend: TCP/443 (HTTPS)
    • Backend: TCP/80 (HTTP)
  4. Add backend servers by IP or server ID.
  5. Configure health checks.

Health Check Configuration

SettingRecommended Value
ProtocolHTTP
Path/health
Interval10 seconds
Timeout5 seconds
Healthy threshold2
Unhealthy threshold3

SSL Termination

Upload your SSL certificate under Load Balancer → SSL Certificates:

>_BASH
$# Generate a self-signed cert for testing
$openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt -subj "/CN=example.com"

For production, use Let's Encrypt or upload your CA-signed certificate.

Sticky Sessions

Enable sticky sessions to route a client's requests to the same backend:

  • Cookie-based — LB injects a cookie; best for stateful apps
  • IP-based — Routes by client IP; simpler but less reliable with NAT

Backend Health Monitoring

>_BASH
$# Check backend status via API
$curl -H "Authorization: Bearer <API_KEY>" https://api.lightyear.host/v1/load-balancers/<LB_ID>/backends

Pricing

ComponentCost
Load Balancer$0.015/hr (~$10.95/month)
BandwidthFirst 10 TB free, then $0.01/GB

Was this article helpful?

Your cookie choices for this website

This site uses cookies and related technologies, as described in our privacy policy, for purposes that may include site operation, analytics, and enhanced user experience. You may choose to consent to our use of these technologies, or manage your own preferences. Cookie policy