linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* LVM vs. Ext4 snapshots (was: [PATCH v1 00/30] Ext4 snapshots)
@ 2011-06-08 18:26 Amir G.
  2011-06-08 18:49 ` Sunil Mushran
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Amir G. @ 2011-06-08 18:26 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: Lukas Czerner, linux-ext4, tytso, linux-kernel, sandeen

On Wed, Jun 8, 2011 at 7:19 PM, Mike Snitzer <snitzer@redhat.com> wrote:
> On Wed, Jun 8, 2011 at 11:59 AM, Amir G. <amir73il@users.sourceforge.net> wrote:
>> On Wed, Jun 8, 2011 at 6:38 PM, Lukas Czerner <lczerner@redhat.com> wrote:
>>> Amir said:
>
>>>> The question of whether the world needs ext4 snapshots is
>>>> perfectly valid, but going back to the food analogy, I think it's
>>>> a case of "the proof of the pudding is in the eating".
>>>> I have no doubt that if ext4 snapshots are merged, many people will use it.
>>>
>>> Well, I would like to have your confidence. Why do you think so ? They
>>> will use it for what ? Doing backups ? We can do this easily with LVM
>>> without any risk of compromising existing filesystem at all. On desktop
>>
>> LVM snapshots are not meant to be long lived snapshots.
>> As temporary snapshots they are fine, but with ext4 snapshots
>> you can easily retain monthly/weekly snapshots without the
>> need to allocate the space for it in advance and without the
>> 'vanish' quality of LVM snapshots.
>
> In that old sf.net wiki you say:
> Why use Next3 snapshots and not LVM snapshots?
> * Performance: only small overhead to write performance with snapshots
>
> Fair claim against current LVM snapshot (but not multisnap).
>
> In this thread you're being very terse on the performance hit you
> assert multisnap has that ext4 snapshots does not.  Can you please be
> more specific?
>
> In your most recent post it seems you're focusing on "LVM snapshots"
> and attributing the deficiencies of old-style LVM snapshots
> (non-shared exception store causing N-way copy-out) to dm-multisnap?
>
> Again, nobody will dispute that the existing dm-snapshot target has
> poor performance that requires snapshots be short-lived.  But
> multisnap does _not_ suffer from those performance problems.
>
> Mike
>

Hi Mike,

I am glad that you joined the debate and I am going to start a fresh
thread for that occasion, to give your question the proper attention.

In my old next3.sf.net wiki, which I do update from time to time,
I listed 4 advantages of Ext4 (then next3) snapshots over LVM:
* Performance: only small overhead to write performance with snapshots
* Scalability: no extra overhead per snapshot
* Maintenance: no need to pre-allocate disk space for snapshots
* Persistence: snapshots don't vanish when disk is full

As far as I know, the only thing that has changed from dm-snap
to dm-multisnap is the Scalability.

Did you resolve the Maintenance and Persistence issues?

With Regards to Performance, Ext4 snapshots are inherently different
then LVM snapshots and have near zero overhead to write performance
as the following benchmark, which I presented on LSF, demonstrates:
http://global.phoronix-test-suite.com/index.php?k=profile&u=amir73il-4632-11284-26560

There are several reasons for the near zero overhead:

1. Metadata buffers are always in cache when performing COW,
so there is no extra read I/O and write I/O of the copied pages is handled
by the journal (when flushing the snapshot file dirty pages).

2. Data blocks are never copied
The move-on-write technique is used to re-allocate data blocks on rewrite
instead of copying them.
This is not something that can be done when the snapshot is stored on
external storage, but it can done when the snapshot file lives in the fs.

3. New (= after last snapshot take) allocated blocks are never copied
nor reallocated on rewrite.
Ext4 snapshots uses the fs block bitmap, to know which blocks were allocated
at the time the last snapshot was taken, so new blocks are just out of the game.
For example, in the workload of a fresh kernel build and daily snapshots,
the creation and deletion of temp files causes no extra I/O overhead whatsoever.

So, yes, I know. I need to run a benchmark of Ext4 snapshots vs. LVM multisnap
and post the results. When I'll get around to it I'll do it.
But I really don't think that performance is how the 2 solutions
should be compared.

The way I see it, LVM snapshots are a complementary solution and they
have several advantages over Ext4 snapshots, like:
* Work with any FS
* Writable snapshots and snapshots of snapshots
* Merge a snapshot back to the main vol

We actually have one Google summer of code project that is going to export
an Ext4 snapshot to an LVM snapshot, in order to implement the "revert
to snapshot"
functionality, which Ext4 snapshots is lacking.

I'll be happy to answer more question regarding Ext4 snapshots.

Thanks,
Amir.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2011-06-13  8:51 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-08 18:26 LVM vs. Ext4 snapshots (was: [PATCH v1 00/30] Ext4 snapshots) Amir G.
2011-06-08 18:49 ` Sunil Mushran
2011-06-09  2:05   ` Yongqiang Yang
2011-06-09 10:52 ` Christoph Hellwig
2011-06-09 11:44   ` Amir G.
2011-06-10  7:45 ` Amir G.
2011-06-10  8:08   ` Amir G.
2011-06-10  9:01     ` Lukas Czerner
2011-06-10 10:11       ` Joe Thornber
2011-06-10 14:15         ` Amir G.
2011-06-10 15:01           ` Joe Thornber
2011-06-11  4:01             ` Amir G.
2011-06-11  7:49               ` Joe Thornber
2011-06-11  8:18                 ` Alex Bligh
2011-06-11  9:44                   ` Amir G.
2011-06-11  5:41         ` Amir G.
2011-06-11  7:35           ` Joe Thornber
2011-06-11  9:58             ` Amir G.
2011-06-13  8:50               ` Joe Thornber

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).