[erlang-questions] On using Mnesia to pass data

Scott Lystig Fritchie fritchie@REDACTED
Wed Mar 7 19:06:57 CET 2007


>>>>> "lc" == Ludovic Coquelle <lcoquelle@REDACTED> writes:

lc> Looks like using mnesia could give me another implementation to
lc> solve the problem: slave write data to mnesia, master read mnesia.
lc> Is it a "good idea" to use mnesia only for data transfer? (don't
lc> care for now that master will have to store data in some db, it's
lc> another issue)

To my reading, this falls squarely in the "overkill" category.  If you
don't need the data to persist when a slave crashes or if the master
crashes, then Mnesia is a huge sledghammer to drive your tack.

After all, with Mnesia you need to specify which node(s) in the
cluster will be storing your data.  Transaction managers will be
necessary to coordinate transaction spanning multiple nodes.  And if
your load generator's data requires more processing by (I'm guessing
here) the master for final presentation, the master will have to
extract the raw/partially cooked data from Mnesia, perhaps requiring
even more cross-node messaging and (perhaps) transaction manager
communication.

Compared to all of that, this slave-to-client reporting code:

    MasterStatsPid ! {load_gen_slave_results, OpStatus, OpDetail}

... and a simple stats gathering proc (assuming on the master) is a
lot simpler.  And remarkably not slow, if performance is worrying you.

-Scott

P.S.  It may be instructive to look at how load generator stats
management is performed by Tsung, http://tsung.erlang-projects.org/



More information about the erlang-questions mailing list