linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Zhang <mingz@ele.uri.edu>
To: Dan Christensen <jdc@uwo.ca>
Cc: David Greaves <david@dgreaves.com>,
	Linux RAID <linux-raid@vger.kernel.org>
Subject: Re: RAID-5 streaming read performance
Date: Thu, 14 Jul 2005 08:30:55 -0400	[thread overview]
Message-ID: <1121344255.5544.7.camel@localhost.localdomain> (raw)
In-Reply-To: <87r7e23uo5.fsf@uwo.ca>

On Wed, 2005-07-13 at 23:58 -0400, Dan Christensen wrote:
> David Greaves <david@dgreaves.com> writes:
> 
> > In my setup I get
> >
> > component partitions, e.g. /dev/sda7: 39MB/s
> > raid device /dev/md2:                 31MB/s
> > lvm device /dev/main/media:           53MB/s
> >
> > (oldish system - but note that lvm device is *much* faster)
> 
> Did you test component device and raid device speed using the
> read-ahead settings tuned for lvm reads?  If so, that's not a fair
> comparison.  :-)
> 
> > For your entertainment you may like to try this to 'tune' your readahead
> > - it's OK to use so long as you're not recording:
> 
> Thanks, I played around with that a lot.  I tuned readahead to
> optimize lvm device reads, and this improved things greatly.  It turns
> out the default lvm settings had readahead set to 0!  But by tuning
> things, I could get my read speed up to 59MB/s.  This is with raw
> device readahead 256, md device readahead 1024 and lvm readahead 2048.
> (The speed was most sensitive to the last one, but did seem to depend
> on the other ones a bit too.)
> 
> I separately tuned the raid device read speed.  To maximize this, I
> needed to set the raw device readahead to 1024 and the raid device
> readahead to 4096.  This brought my raid read speed from 59MB/s to
> 78MB/s.  Better!  (But note that now this makes the lvm read speed
> look bad.)
> 
> My raw device read speed is independent of the readahead setting,
> as long as it is at least 256.  The speed is about 58MB/s.
> 
> Summary:
> 
> raw device:  58MB/s
> raid device: 78MB/s
> lvm device:  59MB/s
> 
> raid still isn't achieving the 106MB/s that I can get with parallel
> direct reads, but at least it's getting closer.
> 
> As a simple test, I wrote a program like dd that reads and discards
> 64k chunks of data from a device, but which skips 1 out of every four
> chunks (simulating skipping parity blocks).  It's not surprising that
> this program can only read from a raw device at about 75% the rate of
> dd, since the kernel readahead is probably causing the skipped blocks
> to be read anyways (or maybe because the disk head has to pass over
> those sections of the disk anyways).
> 
> I then ran four copies of this program in parallel, reading from the
> raw devices that make up my raid partition.  And, like md, they only
> achieved about 78MB/s.  This is very close to 75% of 106MB/s.  Again,
> not surprising, since I need to have raw device readahead turned on
> for this to be efficient at all, so 25% of the chunks that pass
> through the controller are ignored.
> 
> But I still don't understand why the md layer can't do better.  If I
> turn off readahead of the raw devices, and keep it for the raid
> device, then parity blocks should never be requested, so they
> shouldn't use any bus/controller bandwidth.  And even if each drive is
> only acting at 75% efficiency, the four drives should still be able to
> saturate the bus/controller.  So I can't figure out what's going on
> here.
when read, i do not think MD will read parity at all. but since parity
is on all disk, there might be a seek here. so you might want to try a
raid4 to see what happen as well.




> 
> Is there a way for me to simulate readahead in userspace, i.e. can
> I do lots of sequential asynchronous reads in parallel?
> 
> Also, is there a way to disable caching of reads?  Having to clear
> the cache by reading 900M each time slows down testing.  I guess
> I could reboot with mem=100M, but it'd be nice to disable/enable
> caching on the fly.  Hmm, maybe I can just run something like
> memtest which locks a bunch of ram...
after you run your code, check the meminfo, the cached value might be
much lower than u expected. my feeling is that linux page cache will
discard all cache if last file handle closed.


> 
> Thanks for all of the help so far!
> 
> Dan


  parent reply	other threads:[~2005-07-14 12:30 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-11 15:11 RAID-5 streaming read performance Dan Christensen
2005-07-13  2:08 ` Ming Zhang
2005-07-13  2:52   ` Dan Christensen
2005-07-13  3:15     ` berk walker
2005-07-13 12:24     ` Ming Zhang
2005-07-13 12:48       ` Dan Christensen
2005-07-13 12:52         ` Ming Zhang
2005-07-13 14:23           ` Dan Christensen
2005-07-13 14:29             ` Ming Zhang
2005-07-13 17:56               ` Dan Christensen
2005-07-13 22:38                 ` Neil Brown
2005-07-14  0:09                   ` Ming Zhang
2005-07-14  1:16                     ` Neil Brown
2005-07-14  1:25                       ` Ming Zhang
2005-07-13 18:02             ` David Greaves
2005-07-13 18:14               ` Ming Zhang
2005-07-13 21:18                 ` David Greaves
2005-07-13 21:44                   ` Ming Zhang
2005-07-13 21:50                     ` David Greaves
2005-07-13 21:55                       ` Ming Zhang
2005-07-13 22:52                   ` Neil Brown
2005-07-14  3:58               ` Dan Christensen
2005-07-14  4:13                 ` Mark Hahn
2005-07-14 21:16                   ` Dan Christensen
2005-07-14 21:30                     ` Ming Zhang
2005-07-14 23:29                       ` Mark Hahn
2005-07-15  1:23                         ` Ming Zhang
2005-07-15  2:11                           ` Dan Christensen
2005-07-15 12:28                             ` Ming Zhang
2005-07-14 12:30                 ` Ming Zhang [this message]
2005-07-14 14:23                   ` Ming Zhang
2005-07-14 17:54                   ` Dan Christensen
2005-07-14 18:00                     ` Ming Zhang
2005-07-14 18:03                       ` Dan Christensen
2005-07-14 18:10                         ` Ming Zhang
2005-07-14 19:16                           ` Dan Christensen
2005-07-14 20:13                             ` Ming Zhang
2005-07-15  2:38                 ` Dan Christensen
2005-07-15  6:01                   ` Holger Kiehl
2005-07-15 12:29                     ` Ming Zhang
2005-07-13 22:42         ` Neil Brown

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=1121344255.5544.7.camel@localhost.localdomain \
    --to=mingz@ele.uri.edu \
    --cc=david@dgreaves.com \
    --cc=jdc@uwo.ca \
    --cc=linux-raid@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).