Mohamed HADROUJ (Gmail) wrote:
Hi All,
is it possible to design a high availability sms gateway with kannel ? can
kannel manage the load balancing between different sms gateways ?
Hi Mohamed,
yes, this is possible... but(!) (yeah, most of us hate the "bug" sentensace ;)
it's tricky.
The issue is as follows:
Consider a LVS setup, where you have a director and N worker machines (ie. using
NAT). You run into a couple of constraints concerning the upstream connections.
Ie. let's assume we'll have a bunch of SMPP connections. If a single SMPP
account can be bound only for one instance, then you have a problem on which of
the N worker machines (which in optimum case have all the same config setup) is
bound to the account.
So, SMPP account A can be either on machine 1,2,...N. In order to garantee HA,
the setup should be the same on all N workers. Lets assume 3 has the bound
connection to SMPP account A. All others 1,2,4...N will try to connect, but
remove SMPP server refuses, so they are in a "re-connecting" state for this
specific account A. If woker 3 fails, any of the others will "grep" the
connection according to the re-connection attempts. Of course this means we are
querying the SMPP server all the time from N-1 workers that don't get a bind.
That may be considered "abuse" in some sense.
Now, the failing case can be handled that way. What about routing?
A HTTP sendsms request from application layer hits the LVS director and is
passed to one of the N workers. Now, if routing is "hard-wired" (ie. via
allowed-smsc-id values) then you can't garantee that the director passes to the
worker that has the account A instance bound. So you need to rotate through all
workers, so you get in a worst case after N-1 steps to the instance that has the
A route bound and can send it. That "rotation" along the workers currently can
be done only via SMSC HTTP relaying from Kannel instance to instance. Which is
drastical overhead. Also you need to ensure that no item in the rotation chain
that fails causes the rotation to stop.
These are some of the bricks that you need to carry away from your road towards
a HA load-balanced SMS gateway.
Generally speaking: a gateway is hard to HA'harden, since it does both, play the
role of a server (smsbox and it's sendsms HTTP interace) which is more easy, but
also a numerious client towards SMSC, and here it's the tricky part.
BTW, that kind of setup is not theoretical, it's been worked with and on it.
Stipe
-------------------------------------------------------------------
Kölner Landstrasse 419
40589 Düsseldorf, NRW, Germany
tolj.org system architecture Kannel Software Foundation (KSF)
http://www.tolj.org/ http://www.kannel.org/
mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org
-------------------------------------------------------------------