Subject Ramdrive
Author Bernard Devlin
Hi

I have a db sized around 1GB, and was considering what the
performance and reliability issues would be by accessing this db
from a ramdrive, with a shadow on a persistent file system.

If the primary database was on a RAM file system, then it should mean
that even full scans are fast. Because there is a shadow, any
modifications of data would be written to the hard disk. Writing
modifications to the primary db in RAM should be very fast, and the
duplication of writing them to the shadow should not be much
different from writing them to a normal db.

On a reset of the OS (and therefore the disappearance of the primary
db), the shadow could replace the primary db, and so forth. I've
personally never really seen much benefit from Firebird having shadow
dbs (except as a db-only form of RAID 1), but in this scenario the
benefit of having shadows really comes to the fore.

I did some tests with a small db (only 10mb) and a simple join saw an
improvement of about 150% when the db was on the RAM drive. For this
test, I reduced the buffers to only 64 for the dbs on both the
persistent drive and the RAM drive, so buffering would be
negligible. I then increased the buffers on the db on the persistent
drive to 256, 500 and 800, but so no real improvement in speed. It
doesn't look to me like tuning the number of buffers can give
anything like the speed improvement of reading from a db on a RAM
disk.

Also, it would seem to me that as a database gets much bigger than
the one in this simple test, the discrepancy in performance could get
much wider. If I had a couple of GB of RAM I would try it with my
main db and see if the performance disrepancy was magnified. I may
well pump up the size of my test db to a couple of hundred MB to see.

Can anyone recommend any discussons or documentation on this
scenario? I'm sure that initially it seems like a crazy idea -
putting one's valuable data in volatile storage, but doesn't the
shadow make up for this?

A search of a couple of the Yahoo groups did not turn up anything.

I found this discussion in the old Mers group via a search on Google:
http://groups.google.com/groups?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-
8&selm=9od1nj%24mvt%241%40linux.mers.com
However, the discussion was inconclusive (but I think I recognized in
that discussion a few names from this Yahoo group).

I also found this discussion on the IBPhoenix site:
http://www.ibphoenix.com/main.nfs?
a=ibphoenix&l=;IBPHOENIX.MERS_ARCHIVE;MSG_ID='44904'
(The discussion dies very early on from what I can see).

Finally, the idea was floated again very briefly (and closed just as
quickly) in this thread:
http://www.ibphoenix.com/main.nfs?
a=ibphoenix&l=;IBPHOENIX.MERS_ARCHIVE;MSG_ID='28638'

Hopefully we can come to some reasoned conclusion on this matter. I
think I must be missing something, because I don't understand why
there has not really been any discussion of this. I hope we can
avoid the terse "just don't do it" remarks that I found in the
previous discussions.

Bernard.