Just wondering, have you ever made anything useful with a RAM disk in production? I wonder if the performance benefit they afford possibly outweighs their temporary nature in a specific circumstance.
I've only ever used one once, and it wasn't for performance. It was when I needed some writable disk space on a server showing hard drive errors – it gave just enough space for me to install the 3ware RAID utility to identify the dodgy disk.
How have you used a RAM disk in production?
I setup a ramdisk on my mailgateway.
There clamav has a 256MB ramdisk for scanning attachements.
It runs since almost three years, I think its ok :)
Absolutely.
Diskless nodes that have their root FS on a read-only NFS share and strategically mounted
tmpfs
filesystems to allow writing to various parts of the filesystem hierarchy (eg:/tmp
).Nagios can use a ramdisk for dramatic performance increase as this guy figured out:
http://lickthesalt.com/2009/04/19/tweaking-nagios-for-performance/
Yup, Windows PE uses them for loading the PE environment into memory prior to imaging a PC.
I've always been attracted to the notion of using a RAM disk for my swap file location, but never really got round to trying it out, and to be honest I'm not totally certain how well it would work in practice.
A common use is to put MySQL's tmpdir on a ramdisk (e.g. tmpfs) if your web application creates a lot of on-disk temporary tables, i.e.
Created_tmp_disk_tables
is large and getting larger all the time.Cheers
My netbook rsyncs my Firefox profile to a RAM disk on boot, removing the very slightly irritating pauses caused by the urlclassifier file being updated on the not-fast-to-write-to SSD after page loads. It rsyncs it back on full shutdown so new bookmarks and such are not lost between boots (using the inplace option which reduced the number of writes needed in the simple tests I performed) or when I command it to (i.e. after making a number of changes like installing+configuring plugins).
They are also useful for some performance tests when you don't want disk IO to have much impact on the test but /dev/zero and friends won't do for some reason.
They're most useful when going totally disk-less, or when using the disks only for a particular format that the OS wouldn't boot from.
I know it's not a server, but on old macs you used to be able to set a ram-disk up and then install a minimal OS 7 into it, set it as your boot volume, then reboot from it. It seemed scary, but it always worked, and it definitely made the finder act more responsive. Some claimed it even made photoshop run faster, but I was never clear on that.
On a firewall the hard drive was replaced with a compact flash card. A RAM drive is used because CF cards have limited write cycles. On shutdown anything in the RAM drive that needs to be preserved is transferred to the CF card and reloaded on reboot. I am currently looking into creating Linux thin clients using the same idea.
you can store small but frequently r/w files on ramdisk. Some uses I do:
You should check your applications where you have opportunity. A directory qualified to go under tmpfs, if the content
There are legitimate uses for a RAMDISK, but not many. The system cache provides most of the benefits of a RAMDISK without the disadvantages. A RAMDISK requires tying up a substantial amount of RAM when it may be better used for other purposes. You will often optimize one aspect of performance but lose it elsewhere.
Incidentally, using a RAMDISK for the pagefile is completely nonsensical. In virtually every case it will be better to let the system use the RAM as it sees fit.