From: Josh Durgin <jdurgin@redhat.com>
To: Wido den Hollander <wido@42on.com>,
ceph-devel <ceph-devel@vger.kernel.org>
Subject: Re: RBD performance with many childs and snapshots
Date: Tue, 22 Dec 2015 18:04:20 -0800 [thread overview]
Message-ID: <567A0124.5010303@redhat.com> (raw)
In-Reply-To: <5679C6E8.9060702@42on.com>
On 12/22/2015 01:55 PM, Wido den Hollander wrote:
> On 12/21/2015 11:51 PM, Josh Durgin wrote:
>> On 12/21/2015 11:06 AM, Wido den Hollander wrote:
>>> Hi,
>>>
>>> While implementing the buildvolfrom method in libvirt for RBD I'm stuck
>>> at some point.
>>>
>>> $ virsh vol-clone --pool myrbdpool image1 image2
>>>
>>> This would clone image1 to a new RBD image called 'image2'.
>>>
>>> The code I've written now does:
>>>
>>> 1. Create a snapshot called image1@libvirt-<epochtimestamp>
>>> 2. Protect the snapshot
>>> 3. Clone the snapshot to 'image1'
>>>
>>> wido@wido-desktop:~/repos/libvirt$ ./tools/virsh vol-clone --pool
>>> rbdpool image1 image2
>>> Vol image2 cloned from image1
>>>
>>> wido@wido-desktop:~/repos/libvirt$
>>>
>>> root@alpha:~# rbd -p libvirt info image2
>>> rbd image 'image2':
>>> size 10240 MB in 2560 objects
>>> order 22 (4096 kB objects)
>>> block_name_prefix: rbd_data.1976451ead36b
>>> format: 2
>>> features: layering, striping
>>> flags:
>>> parent: libvirt/image1@libvirt-1450724650
>>> overlap: 10240 MB
>>> stripe unit: 4096 kB
>>> stripe count: 1
>>> root@alpha:~#
>>>
>>> But this could potentially lead to a lot of snapshots with children on
>>> 'image1'.
>>>
>>> image1 itself will probably never change, but I'm wondering about the
>>> negative performance impact this might have on a OSD.
>>
>> Creating them isn't so bad, more snapshots that don't change don't have
>> much affect on the osds. Deleting them is what's expensive, since the
>> osds need to scan the objects to see which ones are part of the
>> snapshot and can be deleted. If you have too many snapshots created and
>> deleted, it can affect cluster load, so I'd rather avoid always
>> creating a snapshot.
>>
>>> I'd rather not hardcode a snapshot name like 'libvirt-parent-snapshot'
>>> into libvirt. There is however no way to pass something like a snapshot
>>> name in libvirt when cloning.
>>>
>>> Any bright suggestions? Or is it fine to create so many snapshots?
>>
>> You could have canonical names for the libvirt snapshots like you
>> suggest, 'libvirt-<timestamp>', and check via rbd_diff_iterate2()
>> whether the parent image changed since the last snapshot. That's a bit
>> slower than plain cloning, but with object map + fast diff it's fast
>> again, since it doesn't need to scan all the objects anymore.
>>
>> I think libvirt would need to expand its api a bit to be able to really
>> use it effectively to manage rbd. Hiding the snapshots becomes
>> cumbersome if the application wants to use them too. If libvirt's
>> current model of clones lets parents be deleted before children,
>> that may be a hassle to hide too...
>>
>
> I gave it a shot. callback functions are a bit new to me, but I gave it
> a try:
> https://github.com/wido/libvirt/commit/756dca8023027616f53c39fa73c52a6d8f86a223
>
> Could you take a look?
Left some comments on the commits. Looks good in general.
Josh
prev parent reply other threads:[~2015-12-23 2:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-21 19:06 RBD performance with many childs and snapshots Wido den Hollander
2015-12-21 22:51 ` Josh Durgin
2015-12-22 13:34 ` Wido den Hollander
2015-12-23 2:03 ` Josh Durgin
2015-12-22 21:55 ` Wido den Hollander
2015-12-23 2:04 ` Josh Durgin [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=567A0124.5010303@redhat.com \
--to=jdurgin@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=wido@42on.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