WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Xen, LVM and snapshots

To: Ferenc Wagner <wferi@xxxxxxx>
Subject: Re: [Xen-users] Xen, LVM and snapshots
From: Tomasz Chmielewski <mangoo@xxxxxxxx>
Date: Tue, 14 Oct 2008 21:40:48 +0200
Cc: "Morten W. Petersen" <morten@xxxxxxxxxxxxxx>, xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 14 Oct 2008 12:41:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <87skqzrodr.fsf@xxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <48F4D377.1060503@xxxxxxxxxxxxxx> <87skqzrodr.fsf@xxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.17 (X11/20080929)
Ferenc Wagner schrieb:

(...)

I saw an old message from 2006 on this list, where it is said that
"Common understanding is that LVM2 snapshots are unstable".

I don't understand this statement.

Anything older than 2.6.18 (so, including 2.6.18) will use lots of memory for a snapshot. This means, you won't be able to do more than a handful of snapshots even on a system with lots of free memory (you may expect trouble i.e. you have 512 MB RAM, only 30 MB used, and want to do 10-20 snapshots).

You have 400 MB memory left, did 30 snapshots, and it still works for you? You may reconsider - when they fill, (kernel) memory usage will rise, until your machine is unresponsive. As it's kernel memory being used, oom-killer won't help much here; bigger swap won't help either, because real RAM is needed.


To make the things worse, you will probably be unable to boot the machine again. As the system starts, LVM volumes are detected, memory is full again... You're out of luck, unable to even remove the snapshots in order to boot properly, unless you have some more RAM sticks at hand to fix the problem.


Coincidentally, 2.6.18 kernel is the one Xen is based on (at least dom0), so if you want your Xen server to be a storage server at the same time, you might run into problems as your system grows.
Some major distributions base on this kernel as well (i.e., Debian Etch).



A workaround might be:
- using bigger stripes with LVM (it should take less memory)
- use a newer kernel - as a rule of thumb - the newer, the better - might be problematic with Xen dom0, - have storage on a separate machine (i.e., iSCSI SAN) with a newer kernel than your Xen dom0 machine


Newer kernels (2.6.20, maybe even 2.6.19, and later) are not affected by this "phenomenon".

Another LVM disadvantage is that every snapshot means additional writes.
I.e. if you have a logical volume, and 4 snapshots, writing to the origin will mean 4 more writes are needed. This is a serious scalability problem.


--
Tomasz Chmielewski
http://wpkg.org

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users