linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: MRK <mrk@shiftmail.org>
To: CoolCold <coolthecold@gmail.com>
Cc: Mario <mgiammarco@gmail.com>, linux-raid@vger.kernel.org
Subject: Re: It is possible to put write cache on ssd?
Date: Wed, 09 Jun 2010 13:06:32 +0200	[thread overview]
Message-ID: <4C0F75B8.7020306@shiftmail.org> (raw)
In-Reply-To: <AANLkTikfDks6aTLal8dJLXhMlGxHtMtZ-L_r0r8IQQ4U@mail.gmail.com>

On 06/08/2010 02:23 PM, CoolCold wrote:
> May be something like
> http://github.com/facebook/flashcache/blob/master/doc/flashcache-doc.txt
> will be interesting for you.

There is another one: bcache

http://lkml.indiana.edu/hypermail//linux/kernel/1004.0/01051.html
http://lkml.org/lkml/2010/4/23/376

seems beta stage but nearing completion.
I have not yet investigated all the differences to flashcache. At first 
sight, bcache seems to cache reads, flashcache seems to cache writes.

But be warned that if you use a flash disk as a cache for a big RAID I 
believe it's gonna wear out very quickly.

Consider e.g. bcache caches reads, so on every cache miss it reads 
through the RAID and writes to the flash. If you have indexing programs 
that scrub the whole array (which is clearly larger than the SSD) they 
are going to transform all reads to writes to the flash disk. This is 
going to burn it quickly. I am not sure an SSD is a good medium for 
caching purposes. Try to buy RAM for this.

OTOH caching writes has another big problem:
http://www.legitreviews.com/news/7225/
read the grey box:
There is written that, due to the internal workings of SSDs, without a 
supercapacitor it is not possible to guarantee data integrity upon power 
loss. This is true EVEN if you are running it with cache off (so I 
suppose it is true even if you are using cache flushes or barriers).
Do you really want to lose data upon power loss? Caching writes on an 
SSD is risky...
At least bcache caches only reads, this should be safe I think.

Using a SSD for filesystem journal when the filesystem is on a HDD I 
suppose would not yield big improvements because the bottleneck will 
always be the HDD writes, which won't stay much behind journal commits. 
At most you are going to get the speed you have without a journal (like 
ext2).

Same problem with write-mostly/write-behind I think. I don't know how 
long is the queue that holds data already committed to the SSD and not 
yet committed to the HDD but it can't be too long. I'm reading the "man 
md" right now and it's not extremely clear on this. I have the 
impression the queue between the two it's either the 
/sys/block/hdddevice/queue/nr_requests or it uses the write-intent 
bitmap (if set). In case of the nr_requests, it's gonna be very short so 
the SSD can give you quick bursts but continuous performance will be 
that of the HDD. In case of write-intent bitmap, the delay between the 
two can probably be unbounded, but be warned that if the HDD is even 
just a bit behind the SSD, it's like not having the RAID: if the SSD 
fails, you lose data (might be a lot of data; will also probably need fsck).

What do you think?

  parent reply	other threads:[~2010-06-09 11:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-04  8:52 It is possible to put write cache on ssd? Mario
2010-06-07 19:14 ` Bill Davidsen
2010-06-08  4:54   ` Ian Dall
2010-06-08 19:28     ` Bill Davidsen
2010-06-08 22:48     ` David Rees
2010-06-09  9:31       ` Ian Dall
2010-06-08  7:31   ` Mario
2010-06-08 12:23     ` CoolCold
2010-06-09  7:49       ` Mario
2010-06-09 11:06       ` MRK [this message]
2010-06-09 16:21         ` Aryeh Gregor
2010-06-10 12:08           ` MRK

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C0F75B8.7020306@shiftmail.org \
    --to=mrk@shiftmail.org \
    --cc=coolthecold@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=mgiammarco@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).