Strange mnesia behaviour

Anders Nygren anders_nygren2002@REDACTED
Tue Aug 26 15:36:34 CEST 2003


Hi
Thanks for the explanation.
The idea of my test was to see what happens if my
system gets a flood of alarms. I doubt that it ever
will be the volumes used in my test. But if it ever
becomes a problem I'll just add a buffering process
to add some flow-control. Or maybe I'll use 
dirty_select instead that doesn't have this behaviour.

Are there any other possible problems I should be
aware
of regarding long message queues?

/Anders

 --- Dan Gudmundsson <dgud@REDACTED> skrev: > 
> 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
>  

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