<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John Leach's Blog &#187; storage</title>
	<atom:link href="http://johnleach.co.uk/words/archives/tag/storage/feed" rel="self" type="application/rss+xml" />
	<link>http://johnleach.co.uk/words</link>
	<description>Stuff I think, see and do</description>
	<lastBuildDate>Fri, 18 Jun 2010 22:57:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>LVM snapshot performance</title>
		<link>http://johnleach.co.uk/words/archives/2010/06/18/613/lvm-snapshot-performance</link>
		<comments>http://johnleach.co.uk/words/archives/2010/06/18/613/lvm-snapshot-performance#comments</comments>
		<pubDate>Fri, 18 Jun 2010 22:57:41 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[btrfs]]></category>
		<category><![CDATA[device-mapper]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[zfs]]></category>

		<guid isPermaLink="false">http://johnleach.co.uk/words/?p=613</guid>
		<description><![CDATA[The Linux Logical Volume Manager (LVM) supports creating snapshots of logical volumes (LV) using the device mapper. Device mapper implements snapshots using a copy on write system, so whenever you write to either the source LV or the new snapshot LV, a copy is made first. So a write to a normal LV is just [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)">Linux Logical Volume Manager</a> (LVM) supports creating snapshots of logical volumes (LV) using the device mapper. Device mapper implements snapshots using a copy on write system, so whenever you write to either the source LV or the new snapshot LV, a copy is made first.</p>
<p>So a write to a normal LV is just a write, but a write to a snapshotted LV (or an LV snapshot) involves reading the original data, writing it elsewhere and then writing some metadata about it all.</p>
<p>This quite obviously impacts performance, and due to device mapper having a very basic implementation, it is particularly bad.  My tests show <em>synchronous sequential writes to a snapshotted LV are around 90% slower than writes to a normal LV</em>.</p>
<p><span id="more-613"></span><br />
Once copied and written, writes to the same chunk are only 15% slower.  <span style="font-size: 13.3333px;">Reads are super fast, only a 5% speed impact.</span></p>
<p>Still, not many usage patterns involve huge full speed sequential writes to a filesystem, so LVM is still useful in most circumstances.</p>
<p>I did some tests to see how writes to one snapshotted LV impacted the performance of writes to a completely separate normal LV. Does a snapshotted LV ruin the performance of all your other LVs? Yes, especially if you&#8217;re using the cfq disk scheduler. Switching to the deadline scheduler made things considerably better for the normal LV (but slowed writes to the snapshotted LV a little further).</p>
<p>I did these tests on a 12 disk hardware RAID10 system. The test is a synthetic benchmark so I urge you to do your own tests, but it&#8217;s safe to say that <em>device mapper does not implement clever snapshotting like btrfs or zfs &#8211; don&#8217;t expect great performance from it.</em></p>
<h3>Improving LVM Snapshot performance</h3>
<p>There are a few ways to improve performance of LVM snapshots.  The most obvious one is the chunk size, which can be tweaked when creating the snapshot.  This controls the size of the data that will be copied and written on write operations.  The best setting will depend on lots of stuff, such as your RAID stripe size and your usage patterns.</p>
<p>There is an <a href="http://lkml.org/lkml/2008/9/17/40">as-yet uncommitted patch</a> that improves snapshot write performance a bit by being a bit clever about the disk queuing, but it&#8217;s still slow.</p>
<p>Also, device mapper supports non-persistent snapshots (i.e: lost after reboot), which should avoid having to write the change metadata to disk (which will save a lot of seeks and writes) but LVM doesn&#8217;t seem to support creating these yet.</p>
<p>Putting the snapshot device on a separate disk would help too &#8211; I&#8217;m not sure it&#8217;s possible with LVM, but device mapper does support it.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnleach.co.uk/words/archives/2010/06/18/613/lvm-snapshot-performance/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Virtualized Storage Talk at WYLUG</title>
		<link>http://johnleach.co.uk/words/archives/2008/11/10/325/virtualized-storage-talk-at-wylug</link>
		<comments>http://johnleach.co.uk/words/archives/2008/11/10/325/virtualized-storage-talk-at-wylug#comments</comments>
		<pubDate>Mon, 10 Nov 2008 16:47:32 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[talks]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[wylug]]></category>

		<guid isPermaLink="false">http://johnleach.co.uk/words/?p=325</guid>
		<description><![CDATA[I&#8217;m doing a talk tonight about virtualizing your storage with LVM on Linux at the West Yorkshire Linux User Group. Sorry about the short notice here (it was announced earlier in the week elsewhere though). My mate Paul Brook is talking about RAID on Linux too. Come along for the talk, or the beer, or [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m doing a talk tonight about virtualizing your storage with LVM on Linux at the <a href="http://www.wylug.org.uk/2008/11/wylug-monthly-meeting-monday-10th-november-2008/">West Yorkshire Linux User Group</a>.  Sorry about the short notice here (it was announced earlier in the week elsewhere though).</p>
<p>My mate Paul Brook is talking about RAID on Linux too.</p>
<p>Come along for the talk, or the beer, or the socialising &#8211; or all three.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnleach.co.uk/words/archives/2008/11/10/325/virtualized-storage-talk-at-wylug/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
