Flussonic Load Balancer / Cluster
π Flussonic Cluster Configuration β Load Balancing Mode (Beginner Tutorial)
Flussonic Media Server offers powerful clustering capabilities designed for IPTV and OTT providers. One of the core features of clustering is load balancing, which intelligently distributes client requests across multiple servers.
π What is Load Balancing in Flussonic?
Load balancing ensures:
- βοΈ Even distribution of viewer load
- π Continuous availability (redundancy)
- π Improved performance and throughput
- π§ Easy scalability by adding new servers
Flussonic balances both play and publish requests using the following modes:
π Load Balancing Modes Explained
1. Least number of connections (clients mode):
Sends traffic to the server with the fewest active client connections. Best when you have persistent connections unevenly distributed.
2. Least output bitrate (bitrate mode):
Sends clients to the server currently outputting the least bitrate. Useful when streams vary in bandwidth. Optionally set:
max_bitrate=40M # or 40000000 for 40 Mbps
3. Least bandwidth usage (usage mode):
Sends clients to the server using the smallest percentage of its maximum allowed bitrate.
Bandwidth Usage = (Current Bitrate / Max Bitrate) * 100
You must specify max_bitrate
per server in this mode.
4. Least active streams (streams mode):
Balances by the number of active published streams per server. Useful for stream ingest and transcoding scenarios.
π‘ When should you use a Balancer?
- You operate a streaming platform with 10,000+ viewers
- You plan to scale services dynamically
- You want automated failover and routing logic
Balancer works only with HTTP-based protocols: HLS, DASH, and WebRTC (WHIP/WHEP).
π οΈ Example Setup: 2 Flussonic Servers in Cluster
- Server1:
192.168.1.10
- Server2:
192.168.1.20
- OS: Ubuntu 20.04 (fresh install)
- Access: root
Install Flussonic using our offline guide:

Do this on both servers.
π§ Basic Cluster Configuration
Edit Flussonic config on Server1 at Config > Config Editor
:
# Global settings:
http 80;
http 8088;
rtmp 1935;
pulsedb /var/lib/flussonic;
session_log /var/lib/flussonic;
cluster_key clusterkey;
edit_auth flussonic letmein1;
# Balancer:
balancer global {
mode clients;
server 192.168.1.10;
server 192.168.1.20;
}

On Server2, use the exact same configuration.
π cluster_key
must be identical on all nodes.
Here's a screenshot of what Cluster looks like in Flussonic and how it divides clients equally between 2 servers automatically

Restart Flussonic service on both servers:
systemctl restart flussonic
π§Ύ Explanation of Key Parameters
Directive | Purpose |
---|---|
http 80; |
Web access port |
edit_auth |
Admin login credentials |
balancer global |
Name of cluster balancer context |
mode clients |
Balancing mode: distribute based on least active client connections |
server |
IP addresses of Flussonic nodes |
cluster_key |
Shared key for secure internal cluster communication |
Other available modes:
bitrate
: based on current bitrate outputusage
: based on percent usage of assigned max bitratestreams
: based on count of active published streams
π GeoIP Load Balancing
Use GeoIP-based balancing to direct traffic based on country of client IP using MaxMind GeoLite2.
Example:
balancer geo {
mode bitrate;
server p1 max_bitrate=60M countries=RU;
server p2 max_bitrate=40M countries=RU,CN;
server p3 max_bitrate=30M countries=CN countries_default=true;
server p4 max_bitrate=30M countries_default=true;
}
If user IP is from:
- China β p2 or p3
- Russia β p1 or p2
- Other countries β p3 or p4
β Add a Sample Test Stream
Add this to both servers using same name and same input:
# Ingest stream:
ondemand 1 {
disabled false;
input tshttp://yourstream.com/espn/123456;
title ESPN;
}
π Testing Load Balancer
- Direct stream (non-balanced):