3

I'm looking for a production solution to create a RAM drive that will be safely synchronized with HDD.

I have a piece of custom software with heavy I/O load (this is some kind of proprietary document-oriented DB), and I need to speed it up dramatically. I can't modify or get rid of the software itself, so have to do either horizontal or vertical scaling. The software doesn't support horizontal scout of the box, so I'm looking at vertical scaling first.

The main idea is simple - we buy loads of RAM (96GB) and put whole thing onto a RAM drive. But it needs to be failsafe, loosing any data on server reboot is not an option. So I'm looking for solution that will maintain transparent synchronization between RAM drive and HDD.

Dirty solution like copying files through bash script is not an option, need something more reliable.

In theory as I see, some kind of distributed FS like described here can be used in a weird way - to synchronize two partitions on the same machine. But i doubt if this will work in practice, and never tried that.

So, any ideas on ready solution for a RAM drive with transparent synchro to HDD?


data UPD:

  1. The estimated amount of data I will need to hold in RAM is about 50GB.
  2. Servers are dedicated HP DL320, 8 CPU, 16GB RAM (up to 96GB).
  3. I/O profile is similar to a database application - lots of random access reads, less writes.
6
  • What type of server hardware are you working with?
    – ewwhite
    Nov 1, 2012 at 13:57
  • 1
    And have you tried setting up a RAID array of SSD's?
    – longneck
    Nov 1, 2012 at 13:59
  • buying SSDs for RAID will cost much more than buying RAM, at least with the hosting company we're working with. So we'll go to SSD solution if will not find a RAM one. Nov 1, 2012 at 14:22
  • @user1450663 See my edit below.
    – ewwhite
    Nov 1, 2012 at 14:25
  • 1
    When you edited your question, is there a reason you reverted my changes? I changed Gb to GB for you. Surely you're talking about gigabytes and not gigabits, right?
    – MDMarra
    Nov 1, 2012 at 14:42

3 Answers 3

4

I asked about the hardware available to you because it's possible to obtain low-latency and high-IOPS devices to overcome the limitations of your disks.

However, you did not provide an estimate of the size of your working set of data. That makes a huge difference. We don't have enough information at present. What is the I/O profile of the application? Write-biased? Read-biased? What is the current storage setup?

A generic suggestion would be to use an array of SSD drives. Another would be to use a PCIe accelerator like FusioIO drive.

Maybe even consider DRBD in asynchronous mode...

A more esoteric solution would be to use shared storage that has some degree of tiering that can keep frequently-used data in RAM or on SSD's. The ZFS filesystem and its use of ZIL write acceleration and L2ARC read caching is a good example.

And even more esoteric solution is a software-based caching approach like the Eventually Persistent Ram Disk (EPRD). This creates a disk-backed RAM disk in a FUSE filesystem and can be a good choice for accelerating your application's I/O. This may be what you want...

From the configuration docs:

You can however also create a ramdisk that will have it's
changes flushed to disk every N seconds and instead of keeping
everything in ram it only allocated 512M for caching.

./eprd_setup -f /data/saverimg -s 10G -m 3 -c -p512M

In this example the data is flushed to disk every 3 seconds.

Edit:

If these are HP ProLiant DL320 systems, I'm assuming they're G6 models. Do you have a Smart Array P410 controller and a battery-backed or flash-backed cache installed? If not, that is the first step you should take before going with a RAM disk setup. It makes a difference!

9

You don't want to have an actual RAM disk that synchronizes with a hard drive - what you want is a RAM-based PCIe card with battery backup and NV cache. Basically, a FusionIO card.

5
  • FusionIO looks good, but I guess it's the most expensive solution possible. Data in my task is not this missing critical, so I think we need to explore other solutions first. Nov 1, 2012 at 14:35
  • 4
    You said But it needs to be failsafe, loosing any data on server reboot is not an option. - Any other solution that doesn't involve battery-backed RAM can't work. If your server loses power and you have some scheduled job that goes to disk, you're going to lose data. So, you can either use something like SSD and live with the lower performance (which is usually excellent), or you can use something like a FusionIO and spend the $ but have excellent performance. Anything in between that uses an actual RAM disk and syncs to spindles is going to be susceptible to data loss in a power outage.
    – MDMarra
    Nov 1, 2012 at 14:38
  • FusionIO is the right way to do this. Yes, it's expensive, but if it's a case of having it work, and failsafe, then you should be able to fork out for the card. Nov 1, 2012 at 14:43
  • Okay, then it's a question of balance between how much we want to spend on it and how critical are the possible minor data losses. We'll think on this, thanks for your explanations. Nov 1, 2012 at 14:49
  • 4
    Not a problem. Always remember, you can only pick two of the following three: fast, reliable, cheap.
    – MDMarra
    Nov 1, 2012 at 14:50
3

You cannot do this today, you want 'failsafe' but want to use RAM which is inherently unsafe, that's why NVRAM is made - but it costs. I use FusionIO and of course it's not cheap but that segment of the storage market is changing rapidly and prices are tumbling, look at some of the other vendors selling PCIe-based flash and you'l find less mature products but at much cheaper prices.

Oh and no amount of clever ramdrive syncing will work perfectly, you will get corruption at some point.

Not the answer you're looking for? Browse other questions tagged .