[erlang-questions] Mnesia/dets question - does this make sense?

Nicholas Frechette <>
Fri Sep 3 00:58:16 CEST 2010


Disc_only tables probably write to disk right away and probably don't buffer
so writes can be atomic.
I'm thinking your problem is more likely at the OS/HDD driver level. It is
possible your OS/HDD is caching the data in memory for short amounts of time
in order to speed up subsequent access to said data, once flushed you pay
the full price of accessing that section of the disk again (worse if the
disk had stopped spinning). For example, Windows 7 is actually quite good at
this, using all available memory that isn't being used by applications to
buffer IO (or something like that).

Just a wild guess though, you'll have to profile to understand what is
happening (perhaps at the kernel level to see how much time is spend
actually writing the data by the kernel VS time spent in erlang code).
2cents
Nicholas

On Thu, Sep 2, 2010 at 5:33 PM, Evans, Matthew <> wrote:

> Hi,
>
> I have a fragmented disc_only mnesia table. During tests I have noticed
> that it appears that the access (insert) times to the fragment improve over
> time, and then slow down after a period of inactivity.
>
> Do the tables/fragments get opened and then closed based on a timer that
> would affect initial inert times?
>
> For example, the table has 10 fragments. I see insert times in the 4000us
> range for the first 10 to 15 inserts, and then insert times averaging 400us
> subsequently. If there is no activity on the table for a few minutes access
> times are again in the 4000us range for the first 10 to 15 inserts. As I
> said before it's almost like there is an overhead to get things
> started/warmed up (e.g. opening the fragments/files), once all the fragments
> are opened the speed is fine.
>
> Can anyone confirm this?
>
> Thanks
>
> Matt
>


More information about the erlang-questions mailing list