OpenLoadBalancer logo

OpenLoadBalancer

Organization
OpenLoadBalancer

High-performance zero-dependency L4/L7 load balancer written in Go. Single binary with Web UI, clustering, MCP/AI integration. 8.5K RPS, 39 E2E tests.

PublisherOpenLoadBalancer
Repositoryolb
LanguageGo
Forks
5
Stars
25
Available tools
0
Transport typestdio, streamable-http
Categories
Links
  • Connect tools to AI workflows

    OpenLoadBalancer exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    25 stars and 5 forks from the linked repository.

OpenLoadBalancer

Minimal-dependency L4/L7 load balancer for any backend. One binary. Written in pure Go. Only stdlib + golang.org/x/{crypto,net,text} — no external frameworks. Works with Node.js, Python, Java, Go, Rust, .NET, PHP — anything that speaks HTTP or TCP.

Quick Start

bash
curl -sSL https://openloadbalancer.dev/install.sh | sh

Create olb.yaml (or run olb setup for an interactive wizard):

yaml
admin:
  address: "127.0.0.1:8081"

listeners:
  - name: http
    address: ":80"
    routes:
      - path: /
        pool: web

pools:
  - name: web
    algorithm: round_robin
    backends:
      - address: "10.0.1.10:8080"
      - address: "10.0.1.11:8080"
    health_check:
      type: http
      path: /health
      interval: 10s
bash
olb start --config olb.yaml

That's it. HTTP proxy on :80, admin API on :8081, health checks every 10s, round-robin across two backends.

Install

bash
# Linux / macOS
curl -sSL https://openloadbalancer.dev/install.sh | sh

# Windows (PowerShell)
irm https://openloadbalancer.dev/install.ps1 | iex

# Docker (GHCR)
docker pull ghcr.io/openloadbalancer/olb:latest
docker run -d -p 80:80 -p 8081:8081 \
  -v ./olb.yaml:/etc/olb/configs/olb.yaml \
  ghcr.io/openloadbalancer/olb:latest

# Homebrew
brew tap openloadbalancer/olb && brew install olb

# Build from source
git clone https://github.com/openloadbalancer/olb.git && cd olb && make build

Requires Go 1.26+. Only stdlib + golang.org/x/{crypto,net,text}.

Features

Proxy: HTTP/HTTPS, WebSocket, gRPC, SSE, TCP (L4), UDP (L4), SNI routing, PROXY protocol v1/v2, Request Shadowing/Mirroring

Load Balancing: 16 algorithms — Round Robin, Weighted RR, Least Connections, Weighted Least Connections, Least Response Time, Weighted Least Response Time, IP Hash, Consistent Hash (Ketama), Maglev, Ring Hash, Power of Two, Random, Weighted Random, Rendezvous Hash, Peak EWMA, Sticky Sessions

Geo-DNS Routing: Geographic location-based traffic routing (country, region, city)

Security: TLS termination + SNI, ACME/Let's Encrypt, mTLS, OCSP stapling, 6-layer WAF (IP ACL, rate limiting, request sanitizer, detection engine with SQLi/XSS/path traversal/CMDi/XXE/SSRF, bot detection with JA3 fingerprinting, response protection with security headers + data masking), circuit breaker

Middleware: 16 components — Recovery, body limit, WAF (6-layer pipeline), IP filter, real IP, request ID, timeout, rate limit, circuit breaker, CORS, headers, compression (gzip), retry, cache, metrics, access log

Observability: Web UI dashboard (8 pages), TUI (olb top), Prometheus metrics, structured JSON logging, admin REST API (15+ endpoints), Grafana dashboard

Operations: Hot config reload (SIGHUP or API), Raft clustering + SWIM gossip, service discovery (Static/DNS/Consul/Docker/File), MCP server for AI integration, plugin system, 30+ CLI commands, distributed rate limiting, request shadowing/mirroring

MCP Integration (AI-Powered Management)

OpenLoadBalancer includes a built-in Model Context Protocol (MCP) server that enables AI agents (Claude, GPT, Copilot) to monitor, diagnose, and manage the load balancer.

Transport

  • SSE (Server-Sent Events): GET /sse for streaming + POST /message for commands — MCP spec compliant
  • HTTP POST: POST /mcp for simple request/response (backwards compatible)
  • Stdio: Line-delimited JSON-RPC over stdin/stdout for local CLI tools

Authentication

yaml
admin:
  mcp_address: ":8082"
  mcp_token: "your-secret-token"   # Bearer token auth
  mcp_audit: true                   # Log all tool calls

17 MCP Tools

CategoryTools
Metricsolb_query_metrics — RPS, latency, error rates, connections
Backendsolb_list_backends, olb_modify_backend — Add, remove, drain, enable/disable
Routesolb_modify_route — Add, update, remove routes with traffic splitting
Diagnosticsolb_diagnose — Automated error/latency/capacity/health analysis
Configolb_get_config, olb_get_logs, olb_cluster_status
WAFwaf_status, waf_add_whitelist, waf_add_blacklist, waf_remove_whitelist, waf_remove_blacklist, waf_list_rules, waf_get_stats, waf_get_top_blocked_ips, waf_get_attack_timeline

Connect from Claude Desktop

json
{
  "mcpServers": {
    "olb": {
      "url": "http://localhost:8082/sse",
      "headers": {
        "Authorization": "Bearer your-secret-token"
      }
    }
  }
}

Performance

Benchmarked on AMD Ryzen 9 9950X3D:

MetricResult
Peak RPS15,480 (10 concurrent, round_robin)
Proxy overhead137µs (direct: 87µs → proxied: 223µs)
RoundRobin.Next3.5 ns/op, 0 allocs
Middleware overhead< 3% (full stack vs none)
WAF overhead (6-layer)~35μs per request, < 3% at proxy scale
Binary size~13 MB
P99 latency (50 conc.)22ms
Success rate100% across all tests
AlgorithmRPSAvg LatencyDistribution
random12,9133.5ms32/34/34%
maglev11,5973.8ms68/2/30%
ip_hash11,0624.0ms75/12/13%
power_of_two10,7084.0ms34/33/33%
least_connections10,1194.4ms33/33/34%
consistent_hash8,8974.6ms0/0/100%
weighted_rr8,0425.6ms33/33/34%
round_robin7,3206.3ms35/33/32%

See docs/benchmark-report.md for the complete report including concurrency scaling, backend latency impact, and middleware overhead measurements.

E2E Verified

56+ end-to-end tests across 70 packages with 95.3% coverage:

CategoryVerified
ProxyHTTP, HTTPS/TLS, WebSocket, SSE, TCP, UDP
AlgorithmsRR, WRR, LC, IPHash, CH, Maglev, P2C, Random, RingHash
MiddlewareRate limit (429), CORS, gzip (98% reduction), WAF 6-layer (SQLi/XSS/CMDi/path traversal → 403, rate limit → 429, monitor mode, security headers, bot detection, IP ACL, data masking), IP filter, circuit breaker, cache (HIT/MISS), headers, retry
OperationsHealth check (down/recovery), config reload, weighted distribution, session affinity, graceful failover (0 downtime)
InfraAdmin API, Web UI, Prometheus, MCP server, multiple listeners
Performance15K RPS, 137µs proxy overhead, 100% success rate

Algorithms

AlgorithmConfig NameUse Case
Round Robinround_robinDefault, equal backends
Weighted Round Robinweighted_round_robinUnequal backend capacity
Least Connectionsleast_connectionsLong-lived connections
Least Response Timeleast_response_timeLatency-sensitive
IP Haship_hashSession affinity by IP
Consistent Hashconsistent_hashCache locality
MaglevmaglevGoogle-style hashing
Ring Hashring_hashConsistent with vnodes
Power of Twopower_of_twoBalanced random
RandomrandomSimple, no state

Configuration

Supports YAML, JSON, TOML, and HCL with ${ENV_VAR} substitution.

yaml
admin:
  address: "127.0.0.1:8081"

middleware:
  rate_limit:
    enabled: true
    requests_per_second: 1000
  cors:
    enabled: true
    allowed_origins: ["*"]
  compression:
    enabled: true

waf:
  enabled: true
  mode: enforce
  detection:
    enabled: true
    threshold: {block: 50, log: 25}
  bot_detection: {enabled: true, mode: monitor}
  response:
    security_headers: {enabled: true}

listeners:
  - name: http
    address: ":8080"
    routes:
      - path: /api
        pool: api-pool
      - path: /
        pool: web-pool

pools:
  - name: web-pool
    algorithm: round_robin
    backends:
      - address: "10.0.1.10:8080"
      - address: "10.0.1.11:8080"
    health_check:
      type: http
      path: /health
      interval: 5s

  - name: api-pool
    algorithm: least_connections
    backends:
      - address: "10.0.2.10:8080"
        weight: 3
      - address: "10.0.2.11:8080"
        weight: 2

See docs/configuration.md for all options.

Geo-DNS Routing Example

yaml
geodns:
  enabled: true
  default_pool: default-pool
  rules:
    - id: us-traffic
      country: US
      pool: us-pool
      fallback: default-pool
    - id: eu-traffic
      country: EU
      pool: eu-pool
    - id: asia-traffic
      country: JP
      region: Tokyo
      pool: asia-pool

Request Shadowing Example

yaml
shadow:
  enabled: true
  percentage: 10.0  # Mirror 10% of traffic
  copy_headers: true
  copy_body: false
  timeout: 30s
  targets:
    - pool: staging-pool
      percentage: 100.0

Distributed Rate Limiting Example

yaml
waf:
  enabled: true
  rate_limit:
    enabled: true
    store:
      type: redis
      address: "localhost:6379"
      database: 0
    rules:
      - id: per-ip
        scope: ip
        limit: 1000
        window: 1m

CLI

bash
olb setup                            # Interactive config wizard
olb start --config olb.yaml         # Start proxy
olb stop                             # Graceful shutdown
olb reload                           # Hot-reload config
olb status                           # Server status
olb top                              # Live TUI dashboard
olb backend list                     # List backends
olb backend drain web-pool 10.0.1.10:8080
olb health show                      # Health check status
olb config validate olb.yaml         # Validate config
olb cluster status                   # Cluster info

Architecture

                    ┌─────────────────────────────────────────────────┐
                    │              OpenLoadBalancer                    │
  Clients ─────────┤                                                  │
  HTTP/S, WS,      │  Listeners → Middleware → Router → Balancer → Backends
  gRPC, TCP, UDP   │  (L4/L7)     (16 types)   (trie)   (16 algos)  │
                    │                                                  │
                    │  WAF (6 layers) │ TLS │ Cluster │ MCP │ Web UI  │
                    │  GeoDNS │ Shadow │ Discovery │ Prometheus      │
                    └─────────────────────────────────────────────────┘

Documentation

GuideDescription
Getting StartedStep-by-step tutorial
ConfigurationAll config options
Production DeploymentProduction deployment guide
TroubleshootingTroubleshooting playbook
Migration GuideMigrate from NGINX/HAProxy/Traefik
AlgorithmsAlgorithm details
API ReferenceOpenAPI/Swagger spec
ClusteringMulti-node setup
WAFWeb Application Firewall (6-layer defense)
MCP / AIAI integration
BenchmarksPerformance data
SpecificationTechnical spec

Contributing

See CONTRIBUTING.md. Key rules:

  1. Minimal external deps — stdlib + golang.org/x/{crypto,net,text} only
  2. Tests required — 85% coverage, don't lower it
  3. All features wired — no dead code in engine.go
  4. gofmt + go vet — CI enforced

License

Apache 2.0 — LICENSE

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "openloadbalancer-olb": {
      "command": "npx",
      "args": [
        "-y",
        "olb"
      ]
    }
  }
}

Use OpenLoadBalancer MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once OpenLoadBalancer is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add OpenLoadBalancer as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the OpenLoadBalancer MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "openloadbalancer-olb": {
      "command": "npx",
      "args": [
        "-y",
        "olb"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the OpenLoadBalancer MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the OpenLoadBalancer MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use OpenLoadBalancer to help me with this task?
OpenLoadBalancer
Sure. I read it.
Here is what I found using OpenLoadBalancer.

Option 2: Add an MCP server URL

Use this when OpenLoadBalancer is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter your server URL in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste your server URL into the Server URL field.
  2. Enter a connection name for OpenLoadBalancer.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the OpenLoadBalancer connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the OpenLoadBalancer tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the OpenLoadBalancer tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use OpenLoadBalancer to help me with this task?
OpenLoadBalancer
Sure. I read it.
Here is what I found using OpenLoadBalancer.

Frequently asked questions

What is the OpenLoadBalancer MCP server used for?

OpenLoadBalancer is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use OpenLoadBalancer MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use OpenLoadBalancer with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use OpenLoadBalancer MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With OpenLoadBalancer connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect OpenLoadBalancer MCP to TypingMind?

OpenLoadBalancer can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does OpenLoadBalancer MCP provide in TypingMind?

OpenLoadBalancer exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use OpenLoadBalancer MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If OpenLoadBalancer requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇