[erlang-questions] Load balancing/multiplexing rpc calls amongst Erlang Nodes

Joshua Muzaaya <>
Mon Oct 22 09:43:21 CEST 2012

You can view this question in a better readable version here:
Here goes:

Building from this question <http://stackoverflow.com/q/5339329/431620>,
imagine an application with N Erlang Web Servers, and N/2 Mnesia Database
Nodes. The set up is such that the Web Servers, each, runs on its own
hardware server (say HP DL385), and each Mnesia Instance, runs on its own
hardware Server as well.

Web Servers make rpc:call/4 calls to the back end (the Mnesia DB Servers).
The Data is all replicated across all the Mnesia instances. Now, you want
to have the calls being made to the Database servers, MULTIPLEXED, more
precisely ( by TIME), on each Web Server, so that some kind of LOAD
BALANCING is attained.

If Web Server A makes a connection to Mnesia Instance 3, it cannot make the
next connection to the same Instance. All Database Nodes need to be kept
busy and not having any one of them idle while the others are working. The
Load balancing Algorithm should not be random, but should be aimed at
balancing the load on the Database Servers.

*Qn 1: *Come up with your load balancing strategy, in such a situation.
Also, please show with some sample illustrative code, how you would
implement this strategy.

*Qn 2: * If a Mnesia Instance goes down, how would your load balance
Algorithm adapt to the changes in the cluster ?

*Qn 3: * Is there any Erlang library aimed at load balancing of Erlang
Servers working within the same system, and calling each other via
rpc:call/4 ?

Thank you all.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121022/f56bfc17/attachment.html>

More information about the erlang-questions mailing list