All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Nelson <mark.nelson@inktank.com>
To: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: Cache Tiering Performance Ideas
Date: Wed, 27 Aug 2014 13:20:15 -0500	[thread overview]
Message-ID: <53FE215F.8010300@redhat.com> (raw)

Hi All,

Earlier today I had a great conversation with some of the Gluster 
developers about cache tiering.  They want to implement something 
similar to what we've done and wanted to know what kinds of performance 
problems we've run into and brainstorm ideas to avoid similar issues for 
Gluster.

One of the big problems we've had occurs when using RBD, default 4MB 
block sizes, a cache pool, and 4k reads.  A single 4K read miss will 
currently cause a full-object promotion into the cache.  When you factor 
that journals will also receive a copy of the data and that you will 
want some level of replication (in our case 3x), that actually results 
in 24MB of data to be written the the cache pool. (With 12MB of it 
happening over the network!)

In Gluster they will be caching files rather than objects, and that is 
both good and bad.  A 40GB file promotion is going to be extremely 
expensive, so they will want to be very careful about accounting for the 
size of the files when making promotion decisions.  That will make it 
very tough for them to balance promoting large files when small IO is 
happening agains them.  They have an advantage though that file metadata 
is stored on the same server that makes the promotion decision.  They 
can use things like the file name (higher/lower promotion thresholds 
based on file type) and potentially the file size (except for initial 
writes), to influence when things go to cache.

In Ceph, with something like RBD, I don't think we can easily use file 
information to improve cache tier behaviour.  We may be able to do 
something else.  I wonder if perhaps at the RBD level, we could inspect 
the kind of writes being made to blocks and potentially whether or not 
that write is part of larger sequential write stream.  If so, set a flag 
that would persist with those objects indicating that these objects may 
be part of a large file.  The idea being that the objects are more 
likely to be read back sequentially where we can use read ahead and 
writing to the cache has more disadvantages than advantages.

General Assumptions:

1) Large writes and reads should come from the base pool rather than 
cache.  Big promotions to the cache tier are expensive (network 
consumption, write amplification) and spinning disks are already good at 
doing this kind of thing.

2) Writes to a full cache tier causes other hot or semi-hot data to be 
evicted.  For new writes, even if they are smallish, it might not be 
worth writing to the cache tier if it's full.

3) The best thing the cache tier can provide for us is caching small 
objects, or larger objects with small IO being performed against them. 
For larger objects, the cost of promotion is more expensive than smaller 
objects.


Questions:

1) If RBD is seeing a stream of large writes to consecutive blocks, 
should we set a persistent flag for those objects so that the promotion 
threshold is higher than normal?  The assumption being that until we see 
random small reads/writes being made to them (when we can unset the 
flag), the reads are assumed to also be large.

2) If RBD reads/writes are smaller than some threshold and the cache 
isn't full, should we just promote to cache?  If the cache is full, 
should we be more selective?  Should the threshold be different for 
promotions for reads vs initial writes?

3) Do we have other data available that we can use to guess when a 
promotion won't provide a lot of benefit?

Mark

             reply	other threads:[~2014-08-27 18:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 18:20 Mark Nelson [this message]
     [not found] ` <75674D092A819E4189E91166C74CB90D014281D1@shsmsx102.ccr.corp.intel.com>
     [not found]   ` <51FC7A40FB29414D88A121A7FFEF9A4710F41EA8@SHSMSX104.ccr.corp.intel.com>
2014-08-28 15:20     ` Cache Tiering Performance Ideas Duan, Jiangang

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=53FE215F.8010300@redhat.com \
    --to=mark.nelson@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.