So you want to have extremely fast storage. You also don’t have a boat load of money sitting around to do it with. Well I have a solution. I’ve been experimenting with mdadm and /dev/ram on my system the size of memory disk are 64MB so for testing I’ve created a raid array to see just how fast my memory would act as a ram drive.
#sudo mdadm –create /dev/md3 –level=0 –raid-devices=8 /dev/ram0 /dev/ram1 /dev/ram2 /dev/ram3 /dev/ram4 /dev/ram5 /dev/ram6 /dev/ram7
mdadm: metadata format 00.90 unknown, ignored.
mdadm: metadata format 00.90 unknown, ignored.
mdadm: array /dev/md3 started.
#sudo mke2fs /dev/md3
#sudo mount /dev/md3 /mnt/
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md3 496M 2.3M 468M 1% /mnt
So I get just about a 500 meg ram disk. So then running the following command yield rediculous speeds. Even when were talking about 500megs. Their are easily affordable system with 16gigs of ram, creating a 12gig wouldn’t be that hard to create. Might need to increase the size of ram disk but still. Once you see these numbers. Well here they are.
I did the first test with 4 ram disk in a raid 0. Here are the results.
#/opt/1$ sudo hdparm -t /dev/md4
/dev/md4:
Timing buffered disk reads: 254 MB in 0.34 seconds = 743.04 MB/sec
#/opt/1$ sudo hdparm -t /dev/md4
/dev/md4:
Timing buffered disk reads: 254 MB in 0.35 seconds = 734.65 MB/sec
Now like above I redid the test with the 8 ram disk in a raid 0.
/dev/md3:
Timing buffered disk reads: 510 MB in 0.54 seconds = 936.91 MB/sec
/dev/md3:
Timing buffered disk reads: 510 MB in 0.54 seconds = 937.48 MB/sec
Running the same test on a 500gb plater Seagate 7200.12 I get
#sudo hdparm -t /dev/sdb1
/dev/sdb1:
Timing buffered disk reads: 376 MB in 3.01 seconds = 124.93 MB/sec
Thats a 10x improvement when compared to a regular harddrive. Their are probably other factors to consider.
But one thing this tells me is that I could create a ram disk raid it and then sync data to it that I need to be able to read at a ridiculously rate. With more memory their are more possibilities. Now if only the hardware solution to this wasn’t so ridiculouslyy over priced.
With out the raid I got even better performance you can adjust the size of ram disk, but I haven’t experimented with it my self.
~$ sudo hdparm -t /dev/ram0
/dev/ram0:
Timing buffered disk reads: 64 MB in 0.04 seconds = 1469.95 MB/sec
:~$ sudo hdparm -t /dev/ram0
/dev/ram0:
Timing buffered disk reads: 64 MB in 0.04 seconds = 1711.82 MB/sec
:~$ /dev/ram0:
Timing buffered disk reads: 64 MB in 0.04 seconds = /dev/ram0:
Timing buffered disk reads: 64 MB in 0.04 seconds = 1637.50 MB/sec
ron@router:~$ sudo hdparm -t /dev/ram0
/dev/ram0:
Timing buffered disk reads: 64 MB in 0.04 seconds = 1568.40 MB/sec
MB/sec
$ sudo hdparm -t /dev/ram0
/dev/ram0:
Timing buffered disk reads: 64 MB in 0.04 seconds = 1568.40 MB/sec