An HTTP load balancer that is configurable at runtime
Pull request Compare This branch is 61 commits ahead of epio:master.
Latest commit 79d3c53 Apr 2, 2015 @emate emate Merge pull request #10 from futuresimple/594-status-code
Return 594 status code on backend timeout.


Mantrid is the HTTP load balancer used for Epio. It is designed with high availability and simplicity in mind: it is configured at runtime with JSON over HTTP and can temporarily hold open connections while backend servers restart. It monitors bandwidth and connection statistics and is ideal for serving large numbers of hostnames.

It trades some raw speed for flexibility, but is still designed to be fast. Its aim is to have latency of no more than 10ms, and have no more than a 10% reduction in throughput.


Mantrid is designed to work with Python 2.6 or 2.7, and requires a Python implementation that supports greenlets (so either CPython or PyPy 1.7 and up).

Quick start

Install Mantrid:

$ sudo python install

Launch Mantrid with the default settings (listening on port 80, management on 8042):

$ sudo mantrid

Add a host:

$ mantrid-client set localhost static false type=test

Then visit http://localhost/ to see the test page.


Mantrid is partially configured using a small configuration file (/etc/mantrid/mantrid.conf) which sets up basic things like ports to listen on. The hostnames and load balancing rules are configured at runtime using a REST API, and persisted to a state file on disk so they survive restarts.

A command-line interface, mantrid-client, ships with Mantrid to make simple interactions with the API easier.


Mantrid is released under a BSD (3-clause) license. Contributions are very welcome - come and chat with us in #epio on freenode! If you discover a security issue, please email