Erlang & Hyperthreading

Scott Lystig Fritchie fritchie@REDACTED
Wed Mar 8 00:35:32 CET 2006


>>>>> "tl" == Thomas Lindgren <thomasl_erlang@REDACTED> writes:
tl> --- Ryan Rawson <ryanobjc@REDACTED> wrote:

>> In my circumstance, I run a mnesia database on every node.  Each
>> node answers questions from its local database.  So running N nodes
>> on a N-CPU/SMP system ends up with N copies of the database on 1
>> machine.

tl> This is one case where using multiple nodes easily gets
tl> complicated or expensive.

Thomas hinted at this ... depending on the nature of your application,
you could break the Mnesia nodes into two groups, A & B:

    A nodes which have disc_copies and/or disc_only_copies of the
    app's important tables and do not run application code

    B nodes which have ram_copies of the Mnesia schema only and *do*
    run application code

    A + B = N

Then you have only A copies of the database.  If your application is
fairly CPU-intensive, then you may be able to get away with A = 1,
since the A node(s) "only" has to act like a "database server".(*)

I've done this sort of thing where the A & B nodes are on physically
separate machines.  It worked pretty well for my (still under
development) application.  YMMV.

-Scott

(*) If Mnesia could be called a "client/server database" in this
configuration.  The terms "data-ful" and "data-less" are more
accurate, I suppose, but I don't see those terms used to describe
databases.  {shrug}



More information about the erlang-questions mailing list