linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sitsofe Wheeler <sitsofe@yahoo.com>
To: Andrew Martin <amartin@xes-inc.com>
Cc: linux-bcache@vger.kernel.org
Subject: Re: Performance testing with bcache
Date: Thu, 13 Mar 2014 20:53:02 +0000	[thread overview]
Message-ID: <20140313205259.GA28293@sucs.org> (raw)
In-Reply-To: <2000529324.55683.1394741536677.JavaMail.zimbra@xes-inc.com>

On Thu, Mar 13, 2014 at 03:12:16PM -0500, Andrew Martin wrote:
> 
> I am working on setting up bcache on Ubuntu 13.10 (with kernel 3.11.0-17) 
> for read performance testing in writethrough mode. I've written a test script 
> which uses dd to write data to the bcache device, read it back in, and then 
> attempt to read it again (to measure cache speed):
> # write the data to the disk
> dd if=/dev/zero of=/path/to/bcache/mount/file.raw bs=512 count=2

This will only tell you sequential speeds of small blocks. You may want
to use a tool like fio to let you generate different types of IO
patterns to see what the impact is. For example, the difference between
an hdd's and an sdd's top large block sequential speeds isn't nearly as
dramatic as the difference between their top small block random
speeds...

> # read the data (using iflag=nocache to make sure it gets into bcache's 
> # cache and doesn't use the kernel's cache) 
> dd if=/path/to/bcache/mount/file.raw of=/dev/null iflag=nocache
> 
> # now perform the read, which should read from bcache's cache
> dd if=/path/to/bcache/mount/file.raw of=/dev/null iflag=nocache

This may not perform as you expect it to do. My testing shows that the
read cache bcache is a bit quirky and to see it being used you have to
ensure that the blocks being read the second time are the exact same
size as the blocks that were read the first time. I think that
particular issue is alluded to in TROUBLESHOOTING PERFORMANCE on
http://evilpiepirate.org/git/linux-bcache.git/tree/Documentation/bcache.txt?h=bcache-dev#n126
(Still getting cache misses, of the same data). I would advise you to
warm the cache by doing writes as that doesn't seem to show the problem
but also see below.

> However, if I cat /sys/block/bcache0/bcache/cache/cache_available_percent
> before and after performing the read, the value is always 100. Would using
> iflag=direct be better than iflag=nocache in this case? Is there a better
> way to force data into the cache for this type of performance benchmarking?

The amount free isn't as important as the cache hits/misses ratio.
Additionally I would recommend reading the TROUBLESHOOTING PERFORMANCE
section mentioned above and posting your findings here because the
bcache defaults often defeat first attempt synthetic benchmarking...

-- 
Sitsofe | http://sucs.org/~sits/

  reply	other threads:[~2014-03-13 20:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <155722734.53464.1394740311695.JavaMail.zimbra@xes-inc.com>
2014-03-13 20:12 ` Performance testing with bcache Andrew Martin
2014-03-13 20:53   ` Sitsofe Wheeler [this message]
2014-03-14 18:41     ` Andrew Martin
2014-03-14 21:16       ` Andrew Martin
2014-03-15 17:52         ` Sitsofe Wheeler
2014-04-04 17:06           ` Andrew Martin
2014-04-04 19:10             ` Kent Overstreet
2014-04-05  7:57               ` Sitsofe Wheeler

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=20140313205259.GA28293@sucs.org \
    --to=sitsofe@yahoo.com \
    --cc=amartin@xes-inc.com \
    --cc=linux-bcache@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 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).