Best use of a RAM disk?

25,454

Solution 1

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 :)

Solution 2

Nagios can use a ramdisk for dramatic performance increase as this guy figured out:

http://lickthesalt.com/2009/04/19/tweaking-nagios-for-performance/

Solution 3

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).

Solution 4

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.

Solution 5

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

Share:
25,454

Related videos on Youtube

icecbr
Author by

icecbr

Updated on September 17, 2022

Comments

  • icecbr
    icecbr over 1 year

    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?

  • Ernie
    Ernie almost 15 years
    Why would you use a RAM disk for your swap when Windows would rather use that RAM for... RAM?
  • Deb
    Deb almost 15 years
    In the same vein, all LinuxLIVE disks use a RAM disk for their filesystem.
  • Maximus Minimus
    Maximus Minimus almost 15 years
    @Ernie: I marked up your answer cos it tickled my funny bone. So true. It was mostly back in the Windows 98 days and would have been a symptom of frustration at constant hard disk grinding. :)
  • JSchlather
    JSchlather almost 15 years
    I really like the idea of using to hide the write penalty of SSD. Heck you could even have a directory watcher of sort watch key folders/files (like your bookmarks) and sync them on change in the background. Very cool.
  • Robert MacLean
    Robert MacLean almost 15 years
    -1: He is not asking should you, but what have you done with it in production.
  • pipTheGeek
    pipTheGeek over 14 years
    There is a RAM disk (sorry, can't remember it's name) that allows you to use the memory above the 3GB limit on a 32bit OS to create a RAM disk. This is specifically for the swap file.
  • Vilx-
    Vilx- over 14 years
    If the OS would have a switch that would tell it "please cache this folder to RAM at all times because it's my performance bottleneck" then I would agree with you. Otherwise you can often notice considerable performance improvements when you use a RAMDisk for caching some often-used data.
  • 3dinfluence
    3dinfluence about 14 years
    Including loosing data on the virtual machines when someone trips on the power cord :)
  • notpeter
    notpeter over 13 years
    I use a ramdisk for amavisd temp files on my mail server (running Zimbra), not only is it in production it's vendor supported to boot.
  • Hecter
    Hecter over 12 years
    @pip Now, that would actually make some sense.
  • theist
    theist over 12 years
    @3dinfluence just as amazon ones