Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1012 Bytes

File metadata and controls

38 lines (25 loc) · 1012 Bytes

Simple Static API Load Balancer

Membrane can serve as a software load balancer for APIs. It can distribute requests across multiple backend nodes and handle failures.

This sample shows a simple static configuration. For health checks, sticky sessions, or dynamic discovery, see the other examples.

What You Will Run

  • One Membrane router as the load balancer
  • Three mock services that simulate backend nodes
  • Round-robin request distribution

Run the Example

  1. Go to the examples/loadbalancing/1-static directory.
    cd examples/loadbalancing/1-static
  2. Start Membrane:
    • macOS/Linux: ./membrane.sh
    • Windows: membrane.cmd
  3. Open in a browser:
    http://localhost:8080
    
  4. Refresh the browser a few times.

By refreshing the browser or resending the request you should see responses alternating between node 1, node 2, and node 3.


See: