X-Original-To: pgsql-admin@postgresql.org Received: from biscay.ymogen.com (biscay.ymogen.net [194.164.6.62]) by postgresql.org (Postfix) with SMTP id AE4CE475FBA for ; Mon, 17 Mar 2003 09:27:08 -0500 (EST) Received: (qmail 15347 invoked from network); 17 Mar 2003 14:27:11 -0000 Received: from unknown (HELO solent) (mailuser@213.165.136.12) by 0 with SMTP; 17 Mar 2003 14:27:11 -0000 From: "Matt Clark" To: "Tom Lane" , =?iso-8859-1?Q?Ragnar_Kj=C3zrstad?= Cc: "Peter Eisentraut" , "Murthy Kambhampaty" , Subject: Re: LVM snapshots Date: Mon, 17 Mar 2003 14:27:06 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 In-Reply-To: <5704.1047909881@sss.pgh.pa.us> X-Archive-Number: 200303/253 X-Sequence-Number: 7893 > Ragnar =?iso-8859-15?B?S2rDuHJzdGFk?= 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.