cloudant/rexi — pull request #10 by davisp (2013-03-19 04:05:37+00:00)
Title: Start a rexi_server per remote node

This starts a rexi_server instance for every node in the cluster. When a
node casts a message to a remote node it sends that message directly to
the rexi_server spawned for the local node. This is intended to split
the rexi load across multiple processes to avoid having a single node
handling all rexi traffic.

The addressing system is a fairly straightforward 'rexi_server_%b'
format where the phash2(Node) value is used to for the trailing number.
While it is theoretically possible to use a defined number of
rexi_server instances we would have to either use a random selection
(and assume configurations are consistent between nodes) or use some
sort of hashing scheme. The random version would require more effort for
rexi:kill/2 to select the same server instance as created the ref and
the hashing would likely not distribute messages very well for clusters
with small numbers of nodes.

So while this version adds a bit of extra complexity during startup the
steady state behavior is still preferable for direct addressing of
server instances.