Load balance xmpp traffic to multiple nodes in the backend

ejabberdload balancingxmpp

I have user facing endpoints like xmpp.host.com. However internally i would like to distribute load between xmpp1.host.com, xmpp2.host.com, … What is the best possible way for doing this without moving this logic inside the xmpp server itself

BTW i am using ejabberd right now.

Best Answer

I suggest the use of DNS-based load balancing. By defining multiple SRV records, not only you achieve load balancing, but this can be distributed as you wish (for example you may want 60% of the load on a server with higher capacity, and the remaining to a smaller one), but you can also define failover servers.

An SRV query for an XMPP server like ejabberd may look like: -xmpp_client._tcp.yourdomain

Related Topic