public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Luis Henriques <lhenriques@suse.com>
To: Ilya Dryomov <idryomov@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>, Sage Weil <sage@redhat.com>,
	"Yan, Zheng" <zyan@redhat.com>,
	Gregory Farnum <gfarnum@redhat.com>,
	Ceph Development <ceph-devel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 0/3] parallel 'copy-from' Ops in copy_file_range
Date: Mon, 27 Jan 2020 18:52:03 +0000	[thread overview]
Message-ID: <20200127185203.GC22545@suse.com> (raw)
In-Reply-To: <CAOi1vP9RBBX9RtnZExk_9JX9-H-8B_2R6TQ6-iR3sRw047PfoQ@mail.gmail.com>

On Mon, Jan 27, 2020 at 07:16:17PM +0100, Ilya Dryomov wrote:
> On Mon, Jan 27, 2020 at 5:43 PM Luis Henriques <lhenriques@suse.com> wrote:
> >
> > Hi,
> >
> > As discussed here[1] I'm sending an RFC patchset that does the
> > parallelization of the requests sent to the OSDs during a copy_file_range
> > syscall in CephFS.
> >
> >   [1] https://lore.kernel.org/lkml/20200108100353.23770-1-lhenriques@suse.com/
> >
> > I've also some performance numbers that I wanted to share. Here's a
> > description of the very simple tests I've run:
> >
> >  - create a file with 200 objects in it
> >    * i.e. tests with different object sizes mean different file sizes
> >  - drop all caches and umount the filesystem
> >  - Measure:
> >    * mount filesystem
> >    * full file copy (with copy_file_range)
> >    * umount filesystem
> >
> > Tests were repeated several times and the average value was used for
> > comparison.
> >
> >   DISCLAIMER:
> >   These numbers are only indicative, and different clusters and client
> >   configs will for sure show different performance!  More rigorous tests
> >   would be require to validate these results.
> >
> > Having as baseline a full read+write (basically, a copy_file_range
> > operation within a filesystem mounted without the 'copyfrom' option),
> > here's some values for different object sizes:
> >
> >                           8M      4M      1M      65k
> > read+write              100%    100%    100%     100%
> > sequential               51%     52%     83%    >100%
> > parallel (throttle=1)    51%     52%     83%    >100%
> > parallel (throttle=0)    17%     17%     83%    >100%
> >
> > Notes:
> >
> > - 'parallel (throttle=0)' was a test where *all* the requests (i.e. 200
> >   requests to copy the 200 objects in the file) were sent to the OSDs and
> >   the wait for requests completion is done at the end only.
> >
> > - 'parallel (throttle=1)' was just a control test, where the wait for
> >   completion is done immediately after a request is sent.  It was expected
> >   to be very similar to the non-optimized ('sequential') tests.
> >
> > - These tests were executed on a cluster with 40 OSDs, spread across 5
> >   (bare-metal) nodes.
> >
> > - The tests with object size of 65k show that copy_file_range definitely
> >   doesn't scale to files with small object sizes.  '> 100%' actually means
> >   more than 10x slower.
> >
> > Measuring the mount+copy+umount masks the actual difference between
> > different throttle values due to the time spent in mount+umount.  Thus,
> > there was no real difference between throttle=0 (send all and wait) and
> > throttle=20 (send 20, wait, send 20, ...).  But here's what I observed
> > when measuring only the copy operation (4M object size):
> >
> > read+write              100%
> > parallel (throttle=1)    56%
> > parallel (throttle=5)    23%
> > parallel (throttle=10)   14%
> > parallel (throttle=20)    9%
> > parallel (throttle=5)     5%
> 
> Was this supposed to be throttle=50?

Ups, no it should be throttle=0 (i.e. no throttle).

> >
> > Anyway, I'll still need to revisit patch 0003 as it doesn't follow the
> > suggestion done by Jeff to *not* add another knob to fine-tune the
> > throttle value -- this patch adds a kernel parameter for a knob that I
> > wanted to use in my testing to observe different values of this throttle
> > limit.
> >
> > The goal is to probably to drop this patch and do the throttling in patch
> > 0002.  I just need to come up with a decent heuristic.  Jeff's suggestion
> > was to use rsize/wsize, which are set to 64M by default IIRC.  Somehow I
> > feel that it should be related to the number of OSDs in the cluster
> > instead, but I'm not sure how.  And testing these sort of heuristics would
> > require different clusters, which isn't particularly easy to get.  Anyway,
> > comments are welcome!
> 
> I agree with Jeff, this throttle is certainly not worth a module
> parameter (or a mount option).  I would start with something like
> C * (wsize / object size) and pick C between 1 and 4.

Sure, I also agree with not adding the new parameter or mount option.
It's just tricky to pick (and test!) the best formula to use.  From your
proposal the throttle value would be by default between 16 and 64; those
probably work fine in some situations (for example, in the cluster I used
for running my tests).  But for a really big cluster, with hundreds of
OSDs, it's difficult to say.

Anyway, I'll come up with a proposal for the next revision.  And thanks a
lot for your feedback.

Cheers,
--
Luís

  reply	other threads:[~2020-01-27 18:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27 16:43 [RFC PATCH 0/3] parallel 'copy-from' Ops in copy_file_range Luis Henriques
2020-01-27 16:43 ` [RFC PATCH 1/3] libceph: add non-blocking version of ceph_osdc_copy_from() Luis Henriques
2020-01-27 17:47   ` Ilya Dryomov
2020-01-27 18:39     ` Luis Henriques
2020-01-27 16:43 ` [RFC PATCH 2/3] ceph: parallelize all copy-from requests in copy_file_range Luis Henriques
2020-01-27 17:58   ` Ilya Dryomov
2020-01-27 18:44     ` Luis Henriques
2020-01-28  8:39       ` Ilya Dryomov
2020-01-27 16:43 ` [RFC PATCH 3/3] ceph: add module param to throttle 'copy-from2' operations Luis Henriques
2020-01-27 18:16 ` [RFC PATCH 0/3] parallel 'copy-from' Ops in copy_file_range Ilya Dryomov
2020-01-27 18:52   ` Luis Henriques [this message]
2020-01-28 17:15     ` Gregory Farnum

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=20200127185203.GC22545@suse.com \
    --to=lhenriques@suse.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=gfarnum@redhat.com \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sage@redhat.com \
    --cc=zyan@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