Re: LVM snapshots

From: "Matt Clark" <matt(at)ymogen(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ragnar KjÃzrstad <postgres(at)ragnark(dot)vestdata(dot)no>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "Murthy Kambhampaty" <murthy(dot)kambhampaty(at)goeci(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: LVM snapshots
Date: 2003-03-17 14:27:06
Message-ID: OAEAKHEHCMLBLIDGAFELGEDIDBAA.matt@ymogen.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> Ragnar =?iso-8859-15?B?S2rDuHJzdGFk?= <postgres(at)ragnark(dot)vestdata(dot)no> writes:
> > So, basicly your database will be inresponsive for the time it takes to
> > take a snapshot. The time will depend on the size of the device, the
> > size of the pysical extents (the LVM "blocks") and the raw disk
> > performance, but typically we're talking about periods shorter than a
> > second.
>
> We are? On what size database? Surely it takes longer than a second to
> copy a reasonable-size database.

Ah, a misconception. The terminology is confusing. What is stored on the 'snapshot volume' is not a copy of the 'frozen volume',
but only the writes to the frozen volume. When the 'snapshot volume' is unmounted those updates then get copied back to the 'frozen
volume' which is then unfrozen. The 'snapshot volume' therefore only needs to be big enough to store as much data as will be
written to (or rather as many blocks as will be altered on) the frozen volume while the snapshot is in place.

So when you take a snapshot there is no data to be copied, and when you release a snapshot some data needs to be written back.
Since the data to be copied is nice whole disk blocks and no metadata has to be altered that's a pretty fast operation.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2003-03-17 14:32:19 Re: LVM snapshots
Previous Message Tom Lane 2003-03-17 14:04:41 Re: LVM snapshots