[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.