Skip to main contentSkip to navigation
[email protected]
Client AreaSupport
Hosting Mammoth
HostingMammothYour Data, Our Responsibility
Home
Solutions
Hosting Services
Store
Pricing
About
Blog
API
Contact

Stay Ahead of the Curve

Get the latest insights on cybersecurity, AI innovations, and enterprise data solutions delivered to your inbox.

Hosting Mammoth
HostingMammothEnterprise Solutions

Enterprise-grade data solutions. Hosting, recovery, cybersecurity, and AI-powered services for businesses worldwide.

[email protected]
Sun - Fri, 9:00am - 5:00pm

Services

  • Cloud Hosting
  • Data Recovery
  • Cybersecurity
  • Legal Support
  • MSP Services
  • Web Development
  • AI Services
  • Free Server Migration

Hosting

  • VPS Hosting (NVMe SSD)
  • VDS Hosting (NVMe)
  • Storage VPS (High SSD)
  • GPU Servers
  • Managed Services
  • Cloud Firewall
  • Load Balancer
  • One-Click Apps
  • n8n Hosting
  • Object Storage
  • FAQ

Company

  • Store
  • Pricing
  • About Us
  • Locations
  • Blog
  • Testimonials
  • Contact
  • Affiliate Program
  • White-Label
  • Terms of Service
  • Privacy Policy
  • Browser Cookies
  • SLA

Support

  • Client Area
  • Submit Ticket
  • Knowledge Base
  • Server Status
  • API Documentation

© 2026 Hosting Mammoth. All rights reserved.

Knowledge Base
Getting StartedAccount ManagementVPS HostingGPU ServersStorage VPSCloud FirewallLoad BalancerServer ManagementBilling & PaymentsSupport & TicketsAffiliate ProgramReseller ProgramMarketplace & Appsn8n HostingManaged ServicesServer MigrationAPI & DevelopersSecurityTroubleshootingGlossaryInstall Guides
  1. Home
  2. /
  3. Support
  4. /
  5. Load Balancer
  6. /
  7. Setup Load Balancer
GUIDELoad Balancer

"How to Set Up a Load Balancer"

7 min read

Setting up a load balancer on Data Mammoth distributes incoming traffic across multiple servers, improving your application's performance, reliability, and availability. This guide walks you through the entire setup process, from creating the load balancer to adding backend servers and verifying that everything works.

Prerequisites

Before setting up a load balancer, you need:

  • At least two running servers (VPS or dedicated) hosting the same application. The load balancer distributes traffic across these servers.
  • Your application deployed and working identically on each server. All backend servers should serve the same content and handle the same requests.
  • If using HTTPS, an SSL/TLS certificate for your domain.
If you do not have servers yet, see How to Order Your First Server.

Step 1 — Create a Load Balancer

  • Log in to your Data Mammoth dashboard.
  • Click Network in the left sidebar.
  • Click Load Balancer.
  • Click Create Load Balancer or New Load Balancer.
  • Configure Basic Settings

    • Name — Enter a descriptive name (e.g., "Production Web LB" or "API Load Balancer").
    • Region — Select the data center region. Choose the same region where your backend servers are located for the lowest latency.
    • Type — Select the load balancer type if options are available (Layer 4 or Layer 7).
    Click Create to provision the load balancer. It will be assigned an IP address within a few minutes.

    Step 2 — Configure Forwarding Rules

    Forwarding rules define how the load balancer handles incoming traffic and routes it to backend servers.

  • Open your load balancer's detail page.
  • Click Forwarding Rules or Listeners.
  • Click Add Rule.
  • HTTP Forwarding Rule

    SettingValue
    Frontend ProtocolHTTP
    Frontend Port80
    Backend ProtocolHTTP
    Backend Port80
    This rule listens for HTTP traffic on port 80 and forwards it to port 80 on your backend servers.

    HTTPS Forwarding Rule

    SettingValue
    Frontend ProtocolHTTPS
    Frontend Port443
    Backend ProtocolHTTP
    Backend Port80
    SSL CertificateYour SSL certificate
    This rule handles SSL termination — it decrypts HTTPS traffic and forwards the unencrypted request to backend servers on port 80. See Configuring SSL with Your Load Balancer for certificate setup details.

    Custom Port Forwarding

    For applications running on non-standard ports:

    SettingValue
    Frontend ProtocolTCP
    Frontend Port8080
    Backend ProtocolTCP
    Backend Port8080
    Click Save or Add Rule for each forwarding rule.

    Step 3 — Select the Load Balancing Algorithm

    Choose how the load balancer distributes traffic across backend servers:

    • Round Robin — Sends requests to each server in rotation. Best for servers with equal capacity.
    • Least Connections — Sends requests to the server with the fewest active connections. Best for variable-length requests.
    • IP Hash — Routes requests from the same client IP to the same backend server. Useful for session persistence.
    For a detailed explanation of each algorithm, see Load Balancing Algorithms Explained.

    The default (Round Robin) works well for most web applications. Change the algorithm in the load balancer's settings if needed.

    Step 4 — Add Backend Servers

    Backend servers (also called "targets" or "nodes") are the servers that receive and process traffic from the load balancer.

  • In your load balancer's detail page, click Backend Servers or Targets.
  • Click Add Server.
  • Select a server from your list of active Data Mammoth servers, or enter a server's IP address manually.
  • Specify the port the backend server listens on (e.g., 80 for HTTP).
  • Optionally, set a weight (for weighted round robin — higher weight means more traffic).
  • Click Add.
  • Repeat for each backend server.
  • Example Backend Configuration

    ServerIP AddressPortWeight
    web-server-01203.0.113.10801
    web-server-02203.0.113.11801
    web-server-03203.0.113.12801
    Equal weights distribute traffic evenly. If one server is more powerful, assign a higher weight to send it more traffic.

    Step 5 — Configure Health Checks

    Health checks monitor your backend servers and automatically remove unhealthy servers from the pool. This is essential for maintaining availability.

  • Navigate to the Health Checks section of your load balancer.
  • Configure the health check parameters:
  • SettingRecommended ValueDescription
    ProtocolHTTP or TCPHow to check the server
    Port80Which port to check
    Path/ or /healthURL path for HTTP health checks
    Check Interval10 secondsHow often to check
    Timeout5 secondsMax time to wait for a response
    Healthy Threshold3Consecutive successes to mark healthy
    Unhealthy Threshold3Consecutive failures to mark unhealthy
  • Click Save.
  • For detailed health check configuration, see Configuring Health Checks.

    Step 6 — Configure Session Persistence (Optional)

    If your application requires users to stay connected to the same backend server (e.g., for session-based authentication), enable session persistence (sticky sessions):

  • Navigate to the load balancer's Settings or Session Persistence section.
  • Enable Sticky Sessions.
  • Choose the method:
  • - Cookie-based — The load balancer sets a cookie that identifies the backend server. - IP-based — Requests from the same client IP always go to the same server.
  • Set the session duration (e.g., 30 minutes).
  • Click Save.
  • Note: Sticky sessions can reduce the effectiveness of load balancing because traffic is not evenly distributed. Use them only when your application architecture requires it. Stateless applications do not need sticky sessions.

    Step 7 — Update DNS

    Point your domain to the load balancer instead of an individual server:

  • Go to your DNS provider's management interface.
  • Update or create an A record pointing your domain to the load balancer's IP address.
  • If you previously pointed the domain to a specific server, update it to the load balancer's IP.
  • Wait for DNS propagation (typically minutes to hours).
  • After DNS propagation, all traffic to your domain flows through the load balancer.

    Step 8 — Verify the Setup

    Test Traffic Distribution

  • Access your application through the domain or load balancer IP.
  • Verify the page loads correctly.
  • Check the access logs on each backend server to confirm that requests are being distributed.
  • Test Failover

  • Stop one backend server (or remove it from the pool).
  • Access your application — it should continue working, served by the remaining servers.
  • Start the server again (or add it back) and verify it rejoins the pool.
  • Monitor

    Use your Data Mammoth dashboard to monitor:

    • Load balancer traffic volume.
    • Backend server health status.
    • Request distribution across servers.
    • Response times and error rates.

    What to Do Next

    • Load Balancing Algorithms Explained — Choose the optimal algorithm for your workload.
    • Configuring SSL with Your Load Balancer — Set up HTTPS.
    • Configuring Health Checks — Fine-tune health monitoring.
    • What Is a Load Balancer? — Review the fundamentals.

    Was this article helpful?

    ← Back to Load BalancerBrowse all categories →

    Still have questions?

    Contact Support →Submit a Ticket