Skip to main content
Scale BitBonsai’s encoding capacity by adding worker nodes across multiple machines.

What is Multi-Node Encoding?

Multi-node encoding distributes video transcoding jobs across multiple physical machines, dramatically reducing total encoding time. How it works:
  • Main Node: Owns the PostgreSQL database, distributes jobs, hosts the web UI
  • Child Nodes: Worker-only nodes that pull jobs from the main node’s queue
  • Shared Storage: NFS mount ensures all nodes access the same video files
  • Automatic Load Balancing: Jobs are distributed based on each node’s current load and capacity
Example:

Architecture

The main node owns the database and web UI. Child nodes are workers that connect to the main node’s database.
All nodes must mount the same NFS share to access video files.

Prerequisites

Before setting up multi-node:

Shared Storage Required

All nodes must access the same video files via NFS/SMB network mount.Without shared storage, child nodes cannot read source videos or write encoded files.

Main Node

  • PostgreSQL 15+ (8GB RAM recommended)
  • Docker + Docker Compose
  • NFS mount to video storage

Child Nodes

  • Docker installed
  • NFS mount to same path as main node
  • Network access to main node

Setup Instructions

Step 1: Configure NFS Server

On your NAS or file server:

Step 2: Mount NFS on All Nodes

Mount the shared storage at the same path on every node:
Make permanent in /etc/fstab:

Step 3: Deploy Main Node

On the main node (192.168.1.100):
Start:

Step 4: Deploy Child Nodes

On child node 1 (192.168.1.170):
Start:
Repeat for additional child nodes (192.168.1.171, etc.)

Step 5: Verify Node Registration

Check the web UI at http://192.168.1.100:4210:
  1. Go to Settings → Nodes
  2. You should see:
    • Main Node (192.168.1.100) - Status: ONLINE
    • Child Node 1 (192.168.1.170) - Status: ONLINE
    • Child Node 2 (192.168.1.171) - Status: ONLINE

How Job Distribution Works

BitBonsai uses smart load balancing:
  1. User scans library → Jobs added to queue (status: QUEUED)
  2. Scheduler polls every 5 seconds
  3. For each node:
    • Check current load (active jobs / max concurrent)
    • If load < 100%, assign next QUEUED job to this node
  4. Node picks up job → status changes to ENCODING
  5. Job completes → status changes to COMPLETED
Load calculation:

Troubleshooting

Child Node Not Appearing in UI

Symptom: Child node started but not visible in Settings → Nodes Fix:

Jobs Stuck in QUEUED

Symptom: Jobs remain QUEUED, no node picks them up Fix:
  1. Check all nodes are ONLINE in Settings → Nodes
  2. Verify NFS mounts are working:
  3. Check logs for errors:

File Not Found Errors

Symptom: Job fails with “ENOENT: no such file or directory” Fix:
  • Verify NFS mount path is identical on all nodes
  • Check NFS permissions (should be rw, not ro)
  • Test file access:

Performance Tips