<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><br></div><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div dir="ltr"> </div> <br><meta http-equiv="x-dns-prefetch-control" content="off"><div id="yiv1246425693"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div>Hello everybody,</div><div>This is my first Erlang project and I was evaluating Mnesia's performance.</div><div>I wrote a simple erlang module for doing read and write tests to a disc_copies mnesia database.</div><div>So the data are stored in the disk but the database is loaded in memory.</div><div> A write test consists of a number of records inserted per second in the
 Database, and a read test consists on a number of records that are read per second from the db. Each read or write operation is done inside a transaction. The read and write tests are performed separately.</div><div>Based on Mnesia's performance I define the appropriate load (number of reads/sec or number of writes/sec) that mnesia can handle.</div><div>Since transactional reads require only read locks (other reads can be done without requiring a
 lock), and transactional writes require write locks (exclusive access), I was expecting for mnesia to handle more load for read tests than for write tests. However, the supported load is the same in both the cases. Another observation of mine is the CPU usage, which is around 70% in the read tests (7 times higher than the write tests). Does anybody know why it can happen?</div><div>Since, I do the read tests separately from the write ones, and I have only one db node, I tried doing mnesia reads without using transactions at all. I got a read time that was more than 20 times faster than the time obtained when doing transactional reads. Why is it so huge the difference in performance in such a case? We have just read locks which allow simultaneous read requests to be performed in parallel without any exclusive lock.</div><div>How does the locking mechanism work for transactional reads and writes in Mnesia, and how are these operation
 handled?</div><div><br></div><div>I would be glad if somebody could help me understand some basic stuff about Mnesia IO operations.</div><div>Thanks,</div><div>Genti</div><div><br></div><div><br></div></div></div></div><meta http-equiv="x-dns-prefetch-control" content="on"><br><br> </div> </div>  </div></body></html>