[Linux] Ram Disks
Robert Citek
linux@flux.org
Tue, 15 Jan 2008 12:03:48 -0600
On Jan 15, 2008 9:40 AM, Peter Capazzi <pcapazzi@dwcsolutions.com> wrote:
> Is anyone familiar with Ram Disks?
>
> We have a 3rd party application that apparently needs to read from disk for
> every record as it cycles through anywhere to 50-100 million records. We're
> looking to place this applications resources into a ram disk insead.
>
> I've read through the only tutorial that I beleive applies to what I'm
> trying to do and I'm not sure I understand it completely:
> http://www.vanemery.com/Linux/Ramdisk/ramdisk.html
>
> What I have on my system:
> RAMDISK driver initialized: 16 RAM disks of 64000K size 1024 blocksize
> RAMDISK: Compressed image found at block 0
>
> So I have 16 RAM disks of 64MB each? 1024 MB (1 GB) in total then? The
> applications resource files are about 780MB's... can these ram disks be used
> as an LVM somehow to get the space for the application? Any other ideas?
This might also be of help:
http://www.cyberciti.biz/tips/what-is-devshm-and-its-practical-usage.html
Here's what I did on my Ubuntu machine:
sudo echo -n ; (
set -x
mkdir -p /tmp/ramdisk
sudo mount -t tmpfs -o size=200M tmpfs /tmp/ramdisk
cd /tmp/ramdisk/
df -h .
dd if=/dev/zero of=zeros bs=1M count=180
df -h .
ls -lh
cd
sudo umount /tmp/ramdisk
) >& output.txt
$ cat output.txt
+ mkdir -p /tmp/ramdisk
+ sudo mount -t tmpfs -o size=200M tmpfs /tmp/ramdisk
+ cd /tmp/ramdisk/
+ df -h .
Filesystem Size Used Avail Use% Mounted on
tmpfs 200M 0 200M 0% /tmp/ramdisk
+ dd if=/dev/zero of=zeros bs=1M count=180
180+0 records in
180+0 records out
188743680 bytes (189 MB) copied, 0.232607 seconds, 811 MB/s
+ df -h .
Filesystem Size Used Avail Use% Mounted on
tmpfs 200M 181M 20M 91% /tmp/ramdisk
+ ls --color=tty -lh
total 181M
-rw-r--r-- 1 rwcitek rwcitek 180M 2008-01-15 11:57 zeros
+ cd
+ sudo umount /tmp/ramdisk
Regards,
- Robert