linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Dale Stephenson <dalestephenson@mac.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Performance penalty for 4k requests on thin provisioned volume
Date: Thu, 14 Sep 2017 11:25:26 -0400	[thread overview]
Message-ID: <443B4DE9-E41D-45CB-8CB6-1BC7600E1DBD@mac.com> (raw)
In-Reply-To: <bb529703-849c-93ff-f40c-1de8a6f49ce6@redhat.com>


> On Sep 14, 2017, at 5:00 AM, Zdenek Kabelac <zkabelac@redhat.com> wrote:
> 
> Dne 14.9.2017 v 00:39 Dale Stephenson napsal(a):
>> I could create the md to use 512k chunks for RAID 0, but I wouldn’t expect that to have any impact on a single threaded test using 4k request size.  Is there a hidden relationship that I’m unaware of?
> 
> If you can reevaluate different setups you may possibly get much higher throughput.
> 
To be clear, while I would be interested in hearing about differing setups that would improve the 4k iops performance overall; I am most interested in getting the thin performance comparable to the thick performance.  I did not expect such a large differential between the two types.

> My guess would be - the best targeting layout should be probably striping no more then 2-3 disks and use bigger striping block.
> 
> And then just 'join' 'smaller' arrays together in lvm2 in 1 big LV.
> 
Is this advice given because the drives involved are SSD?  With rotational drives I would never expect concatenated small RAID 0 arrays to provide superior throughput to a single RAID 0.  The best chunk size for sustained throughput depends on the typical transaction, theoretical best case would have typical request size equal to a full stripe.

I would not expect the raid arrangement (at least for RAID 0 or concatenated drives) to have a significant impact on 4k request performance, however.  Too small to take advantage of striping.  Is there a reason why the arrangement would make a difference for this size?
> 
>>> (something like  'lvcreate -LXXX -i8 -I512k vgname’)
>>> 
>> Would making lvm stripe on top of an md that already stripes confer any performance benefit in general, or for small (4k) requests in particular?
> 
> Rule #1 - try to avoid 'over-combining' things together.
> - measure performance from 'bottom'  upward in your device stack.
> If the underlying devices gives poor speed - you can't make it better by any super0smart disk-layout on top of it.
> 
Fair enough.  I have done exactly that — the performance of the underlying md RAID and thick volumes is virtually identical, as I expected.  The thin performance is much, much lower on the same RAID.  So it’s not the underlying layer that is causing the poor speed, it’s the thin volume.

> 
>>> Wouldn't be 'faster' to just concatenate 8 disks together instead of striping - or stripe only across 2 disk - and then you concatenate 4 such striped areas…
>>> 
>> For sustained throughput I would expect striping of 8 disks to blow away concatenation — however, for small requests I wouldn’t expect any advantage. On a non-redundant array, I would expect a single threaded test using 4k requests is going to end up reading/writing data from exactly one disk regardless of whether the underlying drives are concatenated or stripes.
> It always depends which kind of load you expect the most.
> 
> I suspect spreading 4K blocks across 8 SSD is likely very far away from ideal layout.

Very true.  Trying to read/write a single 4k request across 8 drives, whether they are SSD or not, would require a 512-byte chunksize.  Not only is that not possible with md, the overhead associated with generating 8 i/o requests would more than eat up any tiny gain from parallel i/o.  (For rotational drives it’d be even worse, since you’d ensure the response time is governed by the slowest drive).

Which is why for a test like this, which is just using 4k requests in a single thread, I don’t really expect the arrangement of the RAID to have any significant effect.  No matter what kind of drive you are using, and however your drives are arranged, I’d expect the 4k requests only to read or write to a single disk.  So why is it so much slower on thin volumes than thick?

> Any SSD is typically very bad with 4K blocks -  it you want to 'spread' the load on mores SSDs  do not use less the 64K stripe chunks per SSD - this gives you (8*64) 512K stripe size.
> 
I am not using 4k “blocks” anywhere in the remapping layers.  I am using a 4k *request* size.  I want the highest possible number of iops for this request size; I know the throughput will stink compared to larger request sizes, but that’s to be expected.

> As for thin-pool chunksize -  if you plan to use lots of snapshots - keep the value lowest possible - 64K  or 128K thin-pool chunksize.
> 
Snapshots are the main attraction of thin provisioning to me, so 64k would be my preferred thin-pool chunksize for that reason.  However, neither a 64k thin-pool chunksize nor a 512k thin-pool chunksize eliminates the large performance difference between thin and thick volumes for 4k requests.

> But I'd still suggest to reevaluate/benchmark setup where you will use much lower number of SSD for load spreading - and use bigger strip chunks per each device. This should nicely improve performance in case of 'bigger' writes
> and not that much slow things down with  4K loads….
> 
Is the transactional latency so high compared to the data transfer itself that 3-drive SSD RAID 0 should outperform 8-drive SSD RAID 0 for a constant stripe size?  Sounds like an interesting test to run, but I wouldn’t expect it to affect 4k requests.

> 
>> What is the best choice for handling 4k request sizes?
> 
> Possibly NVMe can do a better job here.


What can be done to make *thin provisioning* handle 4k request sizes better?  There may be hardware that performs better for 4k requests than the ones I’m using, but I’m not bothered by the lvm thick volume performance on it.  What can I do to make the lvm thin volume perform as close to thick as possible?

Thank you,
Dale Stephenson

      parent reply	other threads:[~2017-09-14 15:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13 15:33 [linux-lvm] Performance penalty for 4k requests on thin provisioned volume Dale Stephenson
2017-09-13 20:19 ` Zdenek Kabelac
2017-09-13 22:39   ` Dale Stephenson
2017-09-14  9:00     ` Zdenek Kabelac
2017-09-14  9:37       ` Zdenek Kabelac
2017-09-14 10:52         ` Gionatan Danti
2017-09-14 10:57         ` Gionatan Danti
2017-09-14 11:13           ` Zdenek Kabelac
2017-09-14 14:32             ` Dale Stephenson
2017-09-14 15:25       ` Dale Stephenson [this message]

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=443B4DE9-E41D-45CB-8CB6-1BC7600E1DBD@mac.com \
    --to=dalestephenson@mac.com \
    --cc=linux-lvm@redhat.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).