Large Ramdisk creation causes crashes

Matt Roth mroth at imminc.com
Wed Oct 26 15:44:30 UTC 2005


> Hi guys,
> 
> We're trying to build a high performance caching image server using 
> squid. I'm trying to create a large ramdisk for a squid cache directory 
> to overcome the problems we've had with it going to disk.
> 
> I've been seeing very weird crashes when building large ramdisks. Here's 
> what I've done.
> 
> 1) Increase the ramdisk size to (what seems to be a kernel limit) of 512MB.
> in /etc/grub.conf, change the kernel bootup options to
> 
> kernel /vmlinuz-2.6.9-1.667smp ro root=/dev/sda5 selinux=0 rhgb quiet 
> ramdisk_size=524288
> 
> 2) The machine has 4GBs of memory, so I want to create a 3GB raid'ed 
> ramdisk.
> 
> mke2fs -vm0 /dev/ram0
> mke2fs -vm0 /dev/ram1
> mke2fs -vm0 /dev/ram2
> mke2fs -vm0 /dev/ram3
> mke2fs -vm0 /dev/ram4
> mke2fs -vm0 /dev/ram5
>  
> 3) Mount them into some directories i've made...
> 
> mount /dev/ram0 /mnt/r0
> mount /dev/ram1 /mnt/r1 ...
> 
> 4) Without raiding them together, I try to just fill them up.
> 
> perl -e 'print 1 x 600000000' > /mnt/r0
> perl -e 'print 1 x 600000000' > /mnt/r1
> perl -e 'print 1 x 600000000' > /mnt/r2
> perl -e 'print 1 x 600000000' > /mnt/r3 ...
> 
> At some point the machine seems to just freeze and crash. It responds to 
> ping but is unresponsive to ssh or other input and must be powercycled. 
> I know there is enough free memory for this. It seems to happen when I 
> fill just under half of the memory I should have allocated... Allocating 
> less (< 40%) seems to work just fine.
> 
> Anybody know why this happens?
> 
> Brandon

Brandon,

I can't specifically comment on your problem because I haven't encountered it, but one thing in your description seemed strange.  I don't believe there is a kernel limit on the size of the RAM disk.  We are running the x86_64 version of FC3 on a machine with 20GB of RAM with a 16GB RAM disk to overcome some I/O bottlenecks we encountered when digitally recording large numbers of VoIP calls.

The details of our setup can be found here:

 http://lists.digium.com/pipermail/asterisk-users/2005-October/127919.html

Just search for "RAM Disk Setup" because the document is mainly about NFS optimization and Asterisk.

You seem to be experiencing some strange problems and it's my advice that you start at the beginning (the RAM disk limitation) and work your way forward.

I hope this is helpful to you,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer




More information about the fedora-list mailing list