<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>domas mituzas &#187; kernel</title>
	<atom:link href="http://dom.as/tag/kernel/feed/" rel="self" type="application/rss+xml" />
	<link>http://dom.as</link>
	<description></description>
	<lastBuildDate>Thu, 02 Feb 2012 21:29:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dom.as' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/6e344c6e0cd7462eb056f8b98eb2cbcd?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>domas mituzas &#187; kernel</title>
		<link>http://dom.as</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dom.as/osd.xml" title="domas mituzas" />
	<atom:link rel='hub' href='http://dom.as/?pushpress=hub'/>
		<item>
		<title>Postgres kernel regressions</title>
		<link>http://dom.as/2010/09/13/postgres-kernel-regression/</link>
		<comments>http://dom.as/2010/09/13/postgres-kernel-regression/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 14:30:25 +0000</pubDate>
		<dc:creator>Domas Mituzas</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">http://mituzas.lt/?p=791</guid>
		<description><![CDATA[While Mark was looking at MongoDB, I was playing comparing various aspects of MySQL and Postgres performance. Certain PG performance numbers I saw (40kqps vs 110kqps from MySQL) made me really upset, so I ended up discussing with people at &#8230; <a href="http://dom.as/2010/09/13/postgres-kernel-regression/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dom.as&amp;blog=190075&amp;post=791&amp;subd=domasmituzas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While Mark <a href='http://mysqlha.blogspot.com/2010/09/mysql-versus-mongodb-yet-another-silly.html'>was looking at</a> MongoDB, I was playing comparing various aspects of MySQL and Postgres performance. Certain PG performance numbers I saw (40kqps vs 110kqps from MySQL) made me really upset, so I ended up discussing with people at #postgresql &#8211; and started comparing various versions/configurations/machines/etc.</p>
<p>Apparently 2.6.32 kernel, which is in Ubuntu 10.04 LTS (Lucid Lynx) and is also basis for future RHEL6 kernel has nearly 20% performance degradation for PG (though not for MySQL, phew) &#8211; and apparently it was news to their community (I have <a href='http://archives.postgresql.org/pgsql-hackers/2010-09/msg00627.php'>started an email thread</a>, will see where it goes).</p>
<p>While I was doing my research, of course I could observe plenty of gems of wisdom:</p>
<blockquote><p>
&lt;davidfetter&gt; domas, well, as tom lane once said, there&#8217;s no limit to how quickly you can get an answer if it doesn&#8217;t have to be correct
</p></blockquote>
<p>And an hour later:</p>
<blockquote><p>
&lt;rawtaz&gt; are you one of those mysql lovers?<br />
&#8230;<br />
&lt;dim&gt; nobody wants performance at the price of correctness, right?<br />
 &lt;dim&gt; as Tom said, I can be as quick as you want as providing an answer if you don&#8217;t want it to be correct (hint: 42.)
</p></blockquote>
<p>Apparently chasing these performance variations is&#8230;</p>
<blockquote><p>
&lt;Snow-Man&gt; tbh, I&#8217;m of the opinion that we&#8217;re losing the forest for the trees.
</p></blockquote>
<p>Can&#8217;t say that all of them were encouraging:</p>
<blockquote><p>
&lt;sterncera&gt; If you can&#8217;t be bothered to subscribe to -hackers, maybe you shouldn&#8217;t be mailing it
</p></blockquote>
<p>Special thanks goes to <i>mastermind</i>, who not only didn&#8217;t lose his temper, but stayed focused on the topic and resisted my trolling :-) I really want PG to be greatly performing database (and I&#8217;ve seen some great numbers from it), but the amazing amount of ignorance and animosity they have against MySQL makes it somewhat complicated there though :(</p>
<p>P.S. Now all benchmarks I did are tainted and will need full rerun&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/domasmituzas.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/domasmituzas.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/domasmituzas.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/domasmituzas.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/domasmituzas.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/domasmituzas.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/domasmituzas.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/domasmituzas.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/domasmituzas.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/domasmituzas.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/domasmituzas.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/domasmituzas.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/domasmituzas.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/domasmituzas.wordpress.com/791/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dom.as&amp;blog=190075&amp;post=791&amp;subd=domasmituzas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dom.as/2010/09/13/postgres-kernel-regression/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c660a6eb3a4005232acb111303bef12c?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">domasmituzas</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux 2.6.29</title>
		<link>http://dom.as/2009/03/24/linux-2629/</link>
		<comments>http://dom.as/2009/03/24/linux-2629/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 15:16:01 +0000</pubDate>
		<dc:creator>Domas Mituzas</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[io]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://dammit.lt/?p=434</guid>
		<description><![CDATA[2.6.29 was released. I don&#8217;t usually write about linux kernel releases, thats what Slashdot is for :), but this one introduces write barriers in LVM, as well as ext4 with write barriers enabled by default. If you run this kernel &#8230; <a href="http://dom.as/2009/03/24/linux-2629/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dom.as&amp;blog=190075&amp;post=434&amp;subd=domasmituzas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>2.6.29 was released. I don&#8217;t usually write about linux kernel releases, thats what <a href="http://slashdot.org">Slashdot</a> is for :), but this one introduces write barriers in LVM, as well as ext4 with write barriers enabled by default. If you run this kernel and forget to turn off barrier support at filesystems (like XFS, nobarrier), you will see nasty performance slowdowns (<a href="http://dom.as/2008/11/03/xfs-write-barriers/">recent post about it</a>). Beware.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/domasmituzas.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/domasmituzas.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/domasmituzas.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/domasmituzas.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/domasmituzas.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/domasmituzas.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/domasmituzas.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/domasmituzas.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/domasmituzas.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/domasmituzas.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/domasmituzas.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/domasmituzas.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/domasmituzas.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/domasmituzas.wordpress.com/434/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dom.as&amp;blog=190075&amp;post=434&amp;subd=domasmituzas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dom.as/2009/03/24/linux-2629/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c660a6eb3a4005232acb111303bef12c?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">domasmituzas</media:title>
		</media:content>
	</item>
		<item>
		<title>I/O schedulers seriously revisited</title>
		<link>http://dom.as/2008/02/05/linux-io-schedulers/</link>
		<comments>http://dom.as/2008/02/05/linux-io-schedulers/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 12:41:00 +0000</pubDate>
		<dc:creator>Domas Mituzas</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[cfq]]></category>
		<category><![CDATA[deadline]]></category>
		<category><![CDATA[io]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[schedulers]]></category>

		<guid isPermaLink="false">http://dammit.lt/2008/02/05/linux-io-schedulers/</guid>
		<description><![CDATA[The I/O scheduler problems have drawn my attention, and besides trusting empirical results, I tried to do more of benchmarking and analysis, why the heck strange things happen at Linux block layer. So, here is the story, which I found &#8230; <a href="http://dom.as/2008/02/05/linux-io-schedulers/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dom.as&amp;blog=190075&amp;post=97&amp;subd=domasmituzas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://dom.as/2007/12/13/io-scheduler-deadline-cfq/">I/O scheduler problems</a> have drawn my attention, and besides trusting empirical results, I tried to do more of benchmarking and analysis, why the heck strange things happen at Linux block layer. So, here is the story, which I found myself quite fascinating&#8230;<br />
<span id="more-97"></span></p>
<p>The synonym for &#8216;i/o scheduler&#8217; inside Linux kernel is &#8216;elevator&#8217; &#8211; and it helps to explain many things. The physical movement needs of disk spindles are similar to how elevators move people in tall buildings:</p>
<ul>
<li>Attempting of going single direction, just &#8216;up&#8217; or &#8216;down&#8217;, and grabbing all people on their way.</li>
<li>At every floor where it stops, waiting for more people to show up, not closing doors immediately.</li>
<li>More full the elevator cabin is, more efficient it is in terms of transported people.</li>
<li>More full the elevator cabin is, more annoying is for people in it &#8211; stopping at every floor, then waiting, people start hitting &#8216;close door&#8217; button nervously.</li>
<li>Buildings solve this by having more elevators, or sophisticated queueing systems for getting into them</li>
</ul>
<p>Now, imagine a huge hotel building, that is having huge convention of privacy-worshippers. Or just misanthropes. They will never get into elevator, until they know that it is empty, and human that was traveling before got out of elevator safely. Essentially, thats how database transaction serialization works.</p>
<p>Thats where smart elevators fail &#8211; they immediately notice, that all writes are going to same location and prefer to wait for more requests &#8211; and merge them. Though, whenever an elevator decides to wait, nothing happens &#8211; there is a global lock inside database engine, which tells not to write until first write finishes.<br />
Scheduler waits, decides that it did wait too long, flushes the write, gets another request, notices write goes to same location and there might be chance to merge subsequent requests, which&#8230; do not come in again.</p>
<p>And the solution is &#8211; using teleports. Well, at least treating database writes as instant accesses, not caring about order, waiting, just doing everything as soon as possible.</p>
<p>To demonstrate this I went to the world of edge cases &#8211; made the performance test, which maybe shouldn&#8217;t be called a &#8216;benchmark&#8217;. I created a very simple table and started spamming rows, each as a separate transaction, into it. The hardware for test was a &#8216;regular&#8217; DB box, 8 disks, write-behind cache on RAID controller, 16GB of memory, 8 cores &#8211; not my desktop or laptop. The sole idea of test was finding how different I/O modes affect ability to write to I/O controller as fast as possible &#8211; resulting in transaction throughput.</p>
<p>Here are some results:</p>
<table class="benchmarks">
<tbody>
<tr>
<td></td>
<td colspan="2">1 thread</td>
<td colspan="2">8 threads</td>
</tr>
<tr>
<td></td>
<td>tps</td>
<td>ioutil%</td>
<td>tps</td>
<td>ioutil%</td>
</tr>
<tr>
<td>flush=0, deadline</td>
<td>15000</td>
<td>&lt;1%</td>
<td>19100</td>
<td>&lt;1%</td>
</tr>
<tr>
<td>deadline</td>
<td>6850</td>
<td>32%</td>
<td>15250</td>
<td>45%</td>
</tr>
<tr>
<td>cfq</td>
<td>5880</td>
<td>45%</td>
<td><strong>1240</strong></td>
<td>94%</td>
</tr>
</tbody>
</table>
<p>Here, CFQ had very huge regression at higher concurrency, actually Anticipatory showed similar, slightly better results. NOOP showed similar results to deadline, much faster at single thread, slightly slower at multiple.</p>
<p>So, whichever decisions CFQ takes during this test, they must be all wrong &#8211; with multiple disks and raid controller handling flushing of write cache there is no need for elevation or request merging, multiple tagged commands can be sent to the I/O subsystem, and they will be executed swiftly. It is supposed to be a scheduler good for most of workloads, and it probably is. But high-performance databases rely on storage being fast, and for enforcing of ACID requirements, synchronous operations should not wait forever (or wait, when not necessary)</p>
<p>Of course, CFQ may provide better performance on systems that do extensive I/O scanning, so for folks with slow queries it may end up providing more throughput, as it will tolerate delaying small things for big things to get through &#8211; deadline would not care about fairness and try getting everything done as quickly as possible.</p>
<p>The worst part is that Deadline is enabled by default just on community distributions, like Ubuntu Server (though Ubuntu desktop kernel has CFQ by default). So, most of people will end up having anti-database scheduler for ages, and will rarely get into internals of whole stack, or analysis of performance profile. Switching to another scheduler is a matter of single command (though it managed to crash my system once :)</p>
<p>Must read: <a href="http://kerneltrap.org/node/7637">Jens Axboe on his block layer work</a>, and my previous <a href="http://dom.as/2007/12/13/io-scheduler-deadline-cfq/">rant</a> :)</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/domasmituzas.wordpress.com/97/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/domasmituzas.wordpress.com/97/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/domasmituzas.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/domasmituzas.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/domasmituzas.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/domasmituzas.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/domasmituzas.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/domasmituzas.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/domasmituzas.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/domasmituzas.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/domasmituzas.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/domasmituzas.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/domasmituzas.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/domasmituzas.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/domasmituzas.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/domasmituzas.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dom.as&amp;blog=190075&amp;post=97&amp;subd=domasmituzas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dom.as/2008/02/05/linux-io-schedulers/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c660a6eb3a4005232acb111303bef12c?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">domasmituzas</media:title>
		</media:content>
	</item>
	</channel>
</rss>
