Strange mnesia behaviour

Dan Gudmundsson dgud@REDACTED
Tue Aug 26 10:37:51 CEST 2003


Hi

flush_downs() is called once per transaction, (I've added counter to
check), since you in your testprogram cast in all tests you got N long
msg queue which is checked N times, an O(N*N) operation, but if you
wait for the reply before you do the next operation is behaves better.

I do think that is OK, you don't normally have one process with a msq
with a couple of thousends reqs, then you have problems in your app.

Regards 
/Dan

Anders Nygren writes:
 > >  --- Dan Gudmundsson <dgud@REDACTED> skrev:
 > > > 
 > > > Hmm
 > > > 
 > > > flush_downs cleans the msg queue, with alot msgs
 > > in
 > > > it, it takes some 
 > > > time..
 > > > 
 > > > Can you email me the test program?
 > > > 
 > > > /Dan
 > > > 
 > > > Anders Nygren writes:
 > > >  > Hi
 > > >  > I have found a strange thing in mnesia. I was
 > > > trying
 > > >  > to do some throughput measurement on a process.
 > > >  > 
 > > >  > My process does the following:
 > > >  > 1, receive one message
 > > >  > 2, make one mnesia:select
 > > >  > 3, send one message
 > > >  > 
 > > >  > My test was to send N identicat messages to my
 > > > process
 > > >  > and measure the time it took to process all
 > > > messages.
 > > >  > To my suprise the times grew non-linearly with
 > > N.
 > > >  > eprof shows that
 > > >  > N = 10 - > mnesia:flush_downs/0 is called 55
 > > > times
 > > >  > N = 100 -> mnesia:flush_downs/0 is called 5000
 > > > times
 > > >  > N = 4000 -> a whopping 4 million times.
 > > >  > 
 > > >  > Also if I run the test twice with 50 messages I
 > > > get
 > > >  > 2500 mnesia:flush_downs, but when I run one
 > > test
 > > > with
 > > >  > 100 messages there are 5000.
 > > >  > 
 > > >  > I the mnesia table has one record.
 > > >  > I am using a single node -> no distribution.
 > > >  > The table is type bag, disc_copy.
 > > >  > I am using R9C on Suse 8.2.
 > > >  > 
 > > >  > Is there something wrong with mnesia or is
 > > there 
 > > >  > something I dont understand?
 > > >  > 
 > > >  > /Anders
 > > >  > 
 > > >  > Yahoo! Mail - Gratis: 6 MB lagringsutrymme,
 > > > spamfilter och virusscan. Se mer på
 > > > http://se.mail.yahoo.com
 > > >  
 > > 
 > > Yahoo! Mail - Gratis: 6 MB lagringsutrymme,
 > > spamfilter och virusscan. Se mer på
 > http://se.mail.yahoo.com
 > 
 > > ATTACHMENT part 2 application/x-tar
 > name=files.tar.gz
 >  
 > 
 > Yahoo! Mail - Gratis: 6 MB lagringsutrymme, spamfilter och virusscan. Se mer på http://se.mail.yahoo.com




More information about the erlang-questions mailing list