Wednesday, October 3, 2012

How to test RamDisk /Ram disk on centos

It turns out super easy to setup one RAM disk on centos, since linux 2.4 and beyond has the built-in support for ramdisk.

when you check the /dev/ram*, you may see a lot virtual RAM devices.
image

by default the ram device is very small, could be just less than 100Mb, so first step is always incresing the ramdisk size, to do so, append the ramdisk_size=numberofKBs to the boot config /etc/grub.conf

image

restart the server to make it refresh the changes.
now, let me create one fs first on /dev/ram1, mke2fs –m 0 /dev/ram1

image

then create one folder, and map the disk to this folder,
image

however, the ramdisk and data can’t survive the reboot, so you may put some script under rc.local to load the ramdisk and data.

run some basic testing,
image

1 comment:

Torrfriend said...

persistent memory is possible..??

means, we can use mysql db from ram disk, so performance is increases but i am afraid due to volatile , so any solution..??

 
Locations of visitors to this page