Ramdisk Size

Eric R Johnson bioinformaticist at mn.rr.com
Tue Sep 23 15:49:20 EDT 2003


Tony,

Thanks for the advice.  Let me add a little more information and get 
your advice about the ramdisk/tmpfs question.

Without going into a lot of boring details, the goal of this project is 
to create a cluster of workstations whose sole purpose is to constantly 
search the entire contents of a single database over and over again in 
as short a period of time as possible.  That would be it's sole purpose 
for existing.  The database we will be searching is small enough to fit 
into RAM.  As it is a growing database, it may break the 4 Gig barrier, 
but that would simply require switching to something like an Opteron (or 
other 64 bit) based cluster.  Also, the database only changes every 
month, or so, and can be downloaded as a whole new database.  So, in 
summary, this is basically a static database, which is searched, it it's 
entirety, every time, and must be completed in as short a period of time 
as possible on a system dedicated to this task.  Now that you have a 
little more info, do you still recommend tmpfs?  If so, is there a 
specific performance issue that leads us in that direction, because the 
search time is all that matters in this case.

Thanks again for the advice,
Eric


Tony Travis wrote:

> Eric R Johnson wrote:
>
>> I would like to create a large ramdisk to keep a database which will 
>> be searched often, but not changed.
>> The only thing I currently know how to do to create a ramdisk is:
>> mke2fs /dev/ram0
>> mount /dev/ram0 /tmp/ramdisk0
>>
>> The only problem is that this creates a 4MB ramdisk, and I would like 
>> something on the order of 1GB.
>
>
> Hello, Eric.
>
> Are you *sure* you want to do this?
>
> RAM disks are usually used for loading modules at boot time. That's 
> why they are small. Typically, the contents of a RAM disk are used as 
> a root filesystem for the kernel to load e.g. SCSI drivers, then 
> discarded when the 'real' root filesystem is mounted from SCSI disks. 
> People also use them to boot a 'minimal' Linux for diagnostics or for 
> some other reason.
>
> For example, you could create a 10Mb initrd image of a RAM disk using:
>
>     dd if=/dev/zero of=/var/tmp/initrd.img bs=1024 count=10240
>     mkfs -t ext3 /tftpboot/initrd.img
>     mkdir /mnt/ramdisk
>     mount -o loop /tftpboot/initrd.img /mnt/ramdisk
>     cp -a /stuff /mnt/ramdisk    # stuff you want on RAM disk
>     umount /var/tmp/initrd.img
>     zcat /tftpboot/initrd.img > /tftpboot/zinitrd.img
>
> Then, override the 4Mb default at boot time:
>
>     boot: vmlinuz ramdisk_size=10485760 initrd=zinitrd.img
>
> However, I think it would be better to use 'tmpfs' for a 1Gb RAM 
> filesystem. The kernel will provide fast access to the most frequently 
> accessed areas of your database held in RAM, but it will move the less 
> frequently accessed areas onto the swap device freeing up RAM for your 
> programs and for other disk caches.
>
> Mounting /tmp as a 'tmpfs' filesystem reserves half of your memory for 
> the /tmp filesystem by default. Add an entry like this to /etc/fstab:
>
>     tmpfs    /tmp    tmpfs    defaults    0 0
>
> Beware that openMosix, in particular, does not work well with tmpfs 
> and automatically comments out tmpfs entries from your /etc/fstab when 
> you install openMosic from the 2.4.21-openmosix1 binary rpm distribution.
>     
>     Tony.



_______________________________________________
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf



More information about the Beowulf mailing list