<?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>MySQL Performance Blog &#187; hardware</title>
	<atom:link href="http://www.mysqlperformanceblog.com/category/hardware/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com</link>
	<description>Everything about MySQL Performance</description>
	<lastBuildDate>Sat, 21 Nov 2009 03:11:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Beware:  ext3 and sync-binlog do not play well together</title>
		<link>http://www.mysqlperformanceblog.com/2009/01/21/beware-ext3-and-sync-binlog-do-not-play-well-together/</link>
		<comments>http://www.mysqlperformanceblog.com/2009/01/21/beware-ext3-and-sync-binlog-do-not-play-well-together/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 00:42:28 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[operating systems]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=594</guid>
		<description><![CDATA[One of our customers reported strange problem with MySQL having extremely poor performance when sync-binlog=1  is enabled, even though the system with RAID and BBU were expected to have much better performance. 
The problem could be repeated with SysBench as follows:
PLAIN TEXT
CODE:




./sysbench --num-threads=2 --test=oltp --oltp-test-mode=complex --oltp-table-size=100000 --oltp-distinct-ranges=0 --oltp-order-ranges=0 --oltp-sum-ranges=0 --oltp-simple-ranges=0 --oltp-point-selects=0 --oltp-range-size=0 --mysql-table-engine=innodb&#160; --mysql-user=root [...]]]></description>
			<content:encoded><![CDATA[<p>One of our customers reported strange problem with MySQL having extremely poor performance when <strong>sync-binlog=1</strong>  is enabled, even though the system with RAID and BBU were expected to have much better performance. </p>
<p>The problem could be repeated with SysBench as follows:</p>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">./sysbench --num-threads=<span style="color:#800000;color:#800000;">2</span> --test=oltp --oltp-test-mode=complex --oltp-table-size=<span style="color:#800000;color:#800000;">100000</span> --oltp-distinct-ranges=<span style="color:#800000;color:#800000;">0</span> --oltp-order-ranges=<span style="color:#800000;color:#800000;">0</span> --oltp-sum-ranges=<span style="color:#800000;color:#800000;">0</span> --oltp-simple-ranges=<span style="color:#800000;color:#800000;">0</span> --oltp-point-selects=<span style="color:#800000;color:#800000;">0</span> --oltp-range-size=<span style="color:#800000;color:#800000;">0</span> --mysql-table-engine=innodb&nbsp; --mysql-user=root --max-requests=<span style="color:#800000;color:#800000;">0</span> --max-time=<span style="color:#800000;color:#800000;">60</span> --mysql-db=test run </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>On Dell R900 with  CentOS 5.2  and ext3 filesystem we get   <strong>1060 transactions/sec </strong> with single thread and sync_binlog=1  while with 2  threads it drops to  <strong>610 transactions/sec</strong>     Because of synchronous serialized writes to binlog we're not expecting significant improvements in transaction rate (as the load is binlog fsync bound) but   we surely do not expect it to drop ether. </p>
<p>To ensure this is not RAID controller related we repeated the run on the in memory block device and got very similar results -  <strong>2350 transactions/sec</strong> with 2 threads with sync-binlog=0  and just <strong>750 transactions/sec</strong> with sync-binlog=1   </p>
<p>We tried running <strong>data=writeback </strong> and <strong>data=journal</strong> just to make sure but  results were basically the same. </p>
<p>Using <strong>XFS </strong>  instead of EXT3 gives expected results - we get <strong>2350 transactions/sec</strong> with sync_binlog=1 and  <strong>2550 transactions/sec </strong>with sync-binlog=0 which is about 10% overhead.</p>
<p>EXT2 filesystem also behaves similar to XFS so it seems to be EXT3 specific performance issue.  We do not know if it is CentOS/RHEL specific and if it is fixed in the recent kernels.  If somebody can run the same test with different kernels it would be interesting to know results. </p>
<p>You also may wonder how could this problem be unnoticed for a while ?   First it only applies to the binary log.   Innodb transactional log does not have the same problem on EXT3.   I expect this is because Innodb log is pre-allocated so there is not need to modify meta data with each write while binary log is written as growing file.   Another possible reason is small sizes of writes which are being fsync'ed with binary log.  Though these are just my speculations - we did not investigate it in details. </p>
<p>Another reason is - it only happens with high transaction commit rate.  If you're just running couple of hundreds of durable commits a second you may not notice this problem.</p>
<p>Third -  <strong>sync-binlog=1</strong> is an option great for safety but it is surely not the most commonly used one.  The web applications which often have highest transaction rates typically do not have so strong durability requirements to run this option.</p>
<p>As the call for action - I would surely like someone to see if EXT3 can be fixed in this regard as it is by far the most common file system for Linux. It is also worth to investigate if something can be done on MySQL side  - may be opening binlog with O_DSYNC flag if sync_binlog=1 instead of using fsync will help ?  Or may be binlog pre-allocation  would be good solution. </p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by peter |
      <a href="http://www.mysqlperformanceblog.com/2009/01/21/beware-ext3-and-sync-binlog-do-not-play-well-together/#comments">17 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2009/01/21/beware-ext3-and-sync-binlog-do-not-play-well-together/&amp;title=Beware:  ext3 and sync-binlog do not play well together" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2009/01/21/beware-ext3-and-sync-binlog-do-not-play-well-together/&amp;title=Beware:  ext3 and sync-binlog do not play well together" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2009/01/21/beware-ext3-and-sync-binlog-do-not-play-well-together/&amp;title=Beware:  ext3 and sync-binlog do not play well together" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2009/01/21/beware-ext3-and-sync-binlog-do-not-play-well-together/&amp;T=Beware:  ext3 and sync-binlog do not play well together" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2009/01/21/beware-ext3-and-sync-binlog-do-not-play-well-together/&amp;title=Beware:  ext3 and sync-binlog do not play well together" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2009/01/21/beware-ext3-and-sync-binlog-do-not-play-well-together/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>When to use Hardware upgrade instead of Software Optimization</title>
		<link>http://www.mysqlperformanceblog.com/2008/12/05/when-to-use-hardware-upgrade-instead-of-software-optimization/</link>
		<comments>http://www.mysqlperformanceblog.com/2008/12/05/when-to-use-hardware-upgrade-instead-of-software-optimization/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 22:25:06 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[production]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=553</guid>
		<description><![CDATA[One typical question which frequently pops up is whenever it is better to use hardware upgrade or optimize software more.  I already wrote about it, for example here.
Today I'll look at the same topic from the consultants view.  When consultant should suggest hardware upgrade and when it is not in a simple checklist [...]]]></description>
			<content:encoded><![CDATA[<p>One typical question which frequently pops up is whenever it is better to use hardware upgrade or optimize software more.  I already wrote about it, for example <a href="http://www.mysqlperformanceblog.com/2008/03/13/economics-of-performance-optimization/">here</a>.</p>
<p>Today I'll look at the same topic from the consultants view.  When <a href="http://www.percona.com">consultant</a> should suggest hardware upgrade and when it is not in a simple checklist form.</p>
<p><strong>How good is hardware ?</strong>   Sometimes people use so crappy hardware it would be much cheaper for them to upgrade before purchasing much of professional services.  Though in some cases people like their system to be optimal and so they want to run it on some old box even if it costs them more to optimize it.  It may be valid choice allowing to take a hardware boost later down the road when you need a major performance increase and do not have a time for big application changes.</p>
<p><strong>Is current hardware usage balanced ? </strong>  Say  you have 10 servers one of them is overloaded and 8 are almost idle.  In this case proper balancing is the answer rather than getting more hardware.   Of course not all of the applications can be easily balanced but  it is also surprising how many cases of people with reasonable sharded or replicated architecture suffer from wrong balance.   Balancing can be simple operations act or require application changes which is another variable.</p>
<p><strong>Are there any spikes in hardware use ?</strong> Often performance problems  happen only Sometimes..... for example nightly when you do a backup or at  15 minutes off hour when you have some cron job running.   In such cases evening out the usage is often better choice than hardware upgrade and it also can be done easily.</p>
<p><strong>Is MySQL, Queries, Architecture optimized well enough ? </strong>  Do not advice hardware upgrade as the first thing when you can triple performance by simple my.cnf change.   Well enough is a tricky term though.  You need to balance  things and see what can be easily done by consultant or the customer  and what is not.  Adding the indexes is easy.  Changing the query in your own application is easy but is hard for third party application, especially if it is close source.  Big schema changes, caching, sharding can be even more complication - it depends.  The bigger your application is going to be the more optimal you want to be on application level to be efficient.</p>
<p><strong>What is exactly your goal with hardware upgrade ?  </strong> Same as with software optimizations and changes you do should have a goal. You add the index to avoid full table scan and make given query faster.  You add memory to avoid disk IO and make lookups faster.   The goal in the application performance - making throughput better, query faster should lead you to goals in hardware (faster random IO, better caching,  faster execution) which you can use to understand what needs to be done (gettings SSD,  upgrading memory,  upgrading CPUs).   There are number of balancing   questions you have to solve too such as SSD may not need so good in memory caching any more etc.  There is no such thing as better hardware really, just hardware  which serves application needs better.  Many of us probably remember as moving from 4 Core systems to 8 Core reduced performance for many MySQL systems  even though hardware itself was superior.</p>
<p>There are surely more things you can look at but these are simple obvious things you can keep in mind. Do you think I should add something else ? </p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by peter |
      <a href="http://www.mysqlperformanceblog.com/2008/12/05/when-to-use-hardware-upgrade-instead-of-software-optimization/#comments">5 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2008/12/05/when-to-use-hardware-upgrade-instead-of-software-optimization/&amp;title=When to use Hardware upgrade instead of Software Optimization" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2008/12/05/when-to-use-hardware-upgrade-instead-of-software-optimization/&amp;title=When to use Hardware upgrade instead of Software Optimization" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2008/12/05/when-to-use-hardware-upgrade-instead-of-software-optimization/&amp;title=When to use Hardware upgrade instead of Software Optimization" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2008/12/05/when-to-use-hardware-upgrade-instead-of-software-optimization/&amp;T=When to use Hardware upgrade instead of Software Optimization" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2008/12/05/when-to-use-hardware-upgrade-instead-of-software-optimization/&amp;title=When to use Hardware upgrade instead of Software Optimization" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2008/12/05/when-to-use-hardware-upgrade-instead-of-software-optimization/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Scaling to 256-way the Sun way</title>
		<link>http://www.mysqlperformanceblog.com/2008/11/11/scaling-to-256-way-the-sun-way/</link>
		<comments>http://www.mysqlperformanceblog.com/2008/11/11/scaling-to-256-way-the-sun-way/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 04:55:26 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=530</guid>
		<description><![CDATA[As you may have recently seen there are some articles about scaling MySQL one 256-way system. 
I though wow did they really make it work, considering how many bottlenecks remain in MySQL. 
What article really tells us ?
First the number 256 - this is not number of Cores... this is number of hardware threads which [...]]]></description>
			<content:encoded><![CDATA[<p>As you may have recently seen there are <a href="http://blogs.sun.com/mrbenchmark/entry/scaling_mysql_on_a_256">some</a> <a href="http://blogs.sun.com/JenniferGlore/entry/scaling_mysql_on_a_256">articles</a> about scaling MySQL one 256-way system. </p>
<p>I though wow did they really make it work, considering how many bottlenecks remain in MySQL. </p>
<p>What article really tells us ?</p>
<p>First the number 256 - this is not number of Cores... this is number of hardware threads which is not exactly the same thing.   Each T2 Plus CPU has 8 cores, which with 8 threads each giving 64 threads per chip or 256 threads all together.    </p>
<p>Now what is about MySQL scaling to use these 32 cores with 256 threads ?   Especially with the goal of "Do it with minimal tuning i.e as close as possible as out-of-the-box" ?  Do we simply start MySQL server and change couple of defaults to make it work ? </p>
<p>No!  To get really good performance we have to setup <strong>32!</strong> MySQL instances on this box (approximately one per core). </p>
<p>Comparing single instance performance (4350 statements/sec)  to  the total performance archived with 32 instances (79334 statements/sec)   we can see  the single instance gets 1/18 performance archiveable on the system which is of course extremely poor number. </p>
<p>The scale out and ability to scale by using as many MySQL instances as you like is a very good application architecture but unless you have everything absolutely automated in the Google way I do not think you would enjoy running 32 MySQL instances on the box for the single application just to get decent speed. </p>
<p>Now I should point back to my old post about <a href="http://www.mysqlperformanceblog.com/2008/05/01/t2000-cpu-performance-watch-out/">T2000 Perfrormance with MySQL</a>  The Matt Ingenthron commented “Sun” is not, to my knowledge, “aggressively pushing T2000 as Scalable MySQL Platforms”.   - Well what this one would be ? Of course it is not T2000 any more and the CPU performance got a bit better but as I understand single thread performance is still many time slower than one of recent Xeons which makes it really tough call for MySQL which can't perform many operations in parallel.</p>
<p>Now you might got a feeling 79000 queries is a lot ? It is hard to tell without knowing what the queries are but if you just want to look at the queries - <a href="http://www.mysqlperformanceblog.com/2007/04/08/pbxt-benchmarks/">check this out</a> - these are a year and a half old benchmarks on the single MySQL instance showing over 50.000 queries on 8 cores (and close to 40.000 queries/sec on 4 slow AMD cores). </p>
<p>Do not get me wrong. The multi-threading architecture Sun has is great for many applications...  however it is NOT great for MySQL unless you really really do not care about single thread performance (REPLICATION, ALTER TABLE etc) and willing to run insane number of MySQL instances per server. </p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by peter |
      <a href="http://www.mysqlperformanceblog.com/2008/11/11/scaling-to-256-way-the-sun-way/#comments">13 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2008/11/11/scaling-to-256-way-the-sun-way/&amp;title=Scaling to 256-way the Sun way" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2008/11/11/scaling-to-256-way-the-sun-way/&amp;title=Scaling to 256-way the Sun way" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2008/11/11/scaling-to-256-way-the-sun-way/&amp;title=Scaling to 256-way the Sun way" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2008/11/11/scaling-to-256-way-the-sun-way/&amp;T=Scaling to 256-way the Sun way" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2008/11/11/scaling-to-256-way-the-sun-way/&amp;title=Scaling to 256-way the Sun way" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2008/11/11/scaling-to-256-way-the-sun-way/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>128GB or RAM finally got cheap</title>
		<link>http://www.mysqlperformanceblog.com/2008/08/04/128gb-or-ram-finally-got-cheap/</link>
		<comments>http://www.mysqlperformanceblog.com/2008/08/04/128gb-or-ram-finally-got-cheap/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 04:15:18 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=460</guid>
		<description><![CDATA[I did not usually go to "Elite" servers on Dell web site but looking at customers system today I went to check  Dell Poweredge R900.   This monster takes  up to 4 Quad Core CPUs and has 32 memory slots, which allows to get  128GB of memory with 4GB of memory [...]]]></description>
			<content:encoded><![CDATA[<p>I did not usually go to "Elite" servers on Dell web site but looking at customers system today I went to check  Dell Poweredge R900.   This monster takes  up to 4 Quad Core CPUs and has 32 memory slots, which allows to get  128GB of memory with 4GB of memory chips.  This means upgrade to default configuration to 128GB of memory will cost you just $9600  (list price).  I've been able to configure on a web the system with 8*2.5" hard drives RAID and 2 CPUs (just as we usually configure PowerEdge 2950) with 128GB of RAM for about $16000. This means  talking to Dell Sales rep it can purchases within $15000.   This may sounds as a lot but if you're memory constrained it is cheaper per GB than buying  32GB box for $6000 </p>
<p>So am I scale-up advocate ?  No. But it is quite frequently systems are designed to have "working set to fit in memory" to perform well and  such systems can avoid good consolidation factor for such application, or would allow them to delay sharding.</p>
<p>This box also has 4 CPU sockets which means 16  fast cores and 128GB of memory becomes commodity - Quite a challenge for MySQL to take <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>I have not had a chance to play with such box myself besides couple of customer production installations but it looks pretty sweet. </p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by peter |
      <a href="http://www.mysqlperformanceblog.com/2008/08/04/128gb-or-ram-finally-got-cheap/#comments">13 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2008/08/04/128gb-or-ram-finally-got-cheap/&amp;title=128GB or RAM finally got cheap" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2008/08/04/128gb-or-ram-finally-got-cheap/&amp;title=128GB or RAM finally got cheap" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2008/08/04/128gb-or-ram-finally-got-cheap/&amp;title=128GB or RAM finally got cheap" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2008/08/04/128gb-or-ram-finally-got-cheap/&amp;T=128GB or RAM finally got cheap" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2008/08/04/128gb-or-ram-finally-got-cheap/&amp;title=128GB or RAM finally got cheap" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2008/08/04/128gb-or-ram-finally-got-cheap/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>The #1 mistake hosting providers make for MySQL servers</title>
		<link>http://www.mysqlperformanceblog.com/2008/07/25/the-1-mistake-hosting-providers-make-for-mysql-servers/</link>
		<comments>http://www.mysqlperformanceblog.com/2008/07/25/the-1-mistake-hosting-providers-make-for-mysql-servers/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 21:13:07 +0000</pubDate>
		<dc:creator>Baron Schwartz</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=445</guid>
		<description><![CDATA[This article is not meant to malign hosting providers, but I want to point out something you should be aware of if you're getting someone else to build and host your servers for you.
Most hosting providers -- even the big names -- continue to install 32-bit GNU/Linux operating systems on 64-bit hardware.  This is [...]]]></description>
			<content:encoded><![CDATA[<p>This article is not meant to malign hosting providers, but I want to point out something you should be aware of if you're getting someone else to build and host your servers for you.</p>
<p>Most hosting providers -- even the big names -- continue to install 32-bit GNU/Linux operating systems on 64-bit hardware.  This is a serious mistake.</p>
<p>You have to tell them to install a 64-bit operating system.  If you don't then you will come to a point where your needs grow and you want to use more memory -- and they will gladly install 8 or 16GB of memory for you, but MySQL can't use it because it runs in a single process, which is limited to about 2.5GB of memory.  And then you have to rebuild the whole operating system from scratch.  But you don't want any downtime, so you have to buy another server, set it up as a slave, switch your site to use it, and then rebuild the old server.  That 32-bit OS turned into a pretty expensive mistake.</p>
<p>I do not know why the hosting providers keep doing this.  Just yesterday I got a quote from a hosting provider for a medium-high-end system with 8GB of RAM, and forgot to tell them 64-bit OS, and they actually listed 32-bit explicitly on the quote -- useless!  I would estimate about half of all the hosted systems I've seen so far have this mismatch.  I don't know why they do this -- maybe there is a reason, but I don't know it and it looks pretty silly to me.  64-bit hardware and operating systems aren't new anymore.  In fact, 32-bit is hard to find in server-class hardware these days.  So it certainly looks like the hosting companies need to change what they're doing, but maybe there's a different reason.</p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by Baron Schwartz |
      <a href="http://www.mysqlperformanceblog.com/2008/07/25/the-1-mistake-hosting-providers-make-for-mysql-servers/#comments">30 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2008/07/25/the-1-mistake-hosting-providers-make-for-mysql-servers/&amp;title=The #1 mistake hosting providers make for MySQL servers" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2008/07/25/the-1-mistake-hosting-providers-make-for-mysql-servers/&amp;title=The #1 mistake hosting providers make for MySQL servers" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2008/07/25/the-1-mistake-hosting-providers-make-for-mysql-servers/&amp;title=The #1 mistake hosting providers make for MySQL servers" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2008/07/25/the-1-mistake-hosting-providers-make-for-mysql-servers/&amp;T=The #1 mistake hosting providers make for MySQL servers" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2008/07/25/the-1-mistake-hosting-providers-make-for-mysql-servers/&amp;title=The #1 mistake hosting providers make for MySQL servers" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2008/07/25/the-1-mistake-hosting-providers-make-for-mysql-servers/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>T2000 CPU Performance &#8211; Watch out</title>
		<link>http://www.mysqlperformanceblog.com/2008/05/01/t2000-cpu-performance-watch-out/</link>
		<comments>http://www.mysqlperformanceblog.com/2008/05/01/t2000-cpu-performance-watch-out/#comments</comments>
		<pubDate>Thu, 01 May 2008 17:00:25 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[production]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/05/01/t2000-cpu-performance-watch-out/</guid>
		<description><![CDATA[Sun is aggressively pushing  T2000 as Scalable MySQL Platforms, and indeed it is Scalable in terms of high concurrency workloads - it is able to execute a lot of concurrent threads and so speed gain from 1 thread to say 32 thread will be significant. 
But thing a lot of people miss is - [...]]]></description>
			<content:encoded><![CDATA[<p>Sun is aggressively pushing  <a href="http://www.sun.com/servers/coolthreads/t2000/">T2000</a> as Scalable MySQL Platforms, and indeed it is Scalable in terms of high concurrency workloads - it is able to execute a lot of concurrent threads and so speed gain from 1 thread to say 32 thread will be significant. </p>
<p>But thing a lot of people miss is - <strong>Being Scalable is Not Enough</strong> - you need to scale from reasonable base to claim the good performance, and this is where T2000 performs subpar in many cases.</p>
<p>I often hear about people complaining queries take much longer on T2000 compared to recent Intel or AMD CPUs when there is no concurrent load -  It is reported T2000 can be as much as <strong>5-15 times slower</strong> in this case depending on the workload. </p>
<p>Here is example run of purely CPU consuming "Benchmark" function for 2.6Ghz Intel Xeon  vs T2000:</p>
<div class="igBar"><span id="lsql-4"><a href="#" onclick="javascript:showPlainTxt('sql-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-4">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># XEON</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mysql&gt; <span style="color: #993333; font-weight: bold;">SELECT</span> benchmark<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">100000000</span>,<span style="color: #cc66cc;color:#800000;">1</span>+<span style="color: #cc66cc;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+<span style="color: #808080; font-style: italic;">--------------------------+</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">| benchmark<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">100000000</span>,<span style="color: #cc66cc;color:#800000;">1</span>+<span style="color: #cc66cc;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span> |</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+<span style="color: #808080; font-style: italic;">--------------------------+</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;color:#800000;">0</span> |</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+<span style="color: #808080; font-style: italic;">--------------------------+</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc66cc;color:#800000;">1</span> row <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span>.<span style="color: #cc66cc;color:#800000;">50</span> sec<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># T2000</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mysql&gt; <span style="color: #993333; font-weight: bold;">SELECT</span> benchmark<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">100000000</span>,<span style="color: #cc66cc;color:#800000;">1</span>+<span style="color: #cc66cc;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+<span style="color: #808080; font-style: italic;">--------------------------+</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">| benchmark<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">100000000</span>,<span style="color: #cc66cc;color:#800000;">1</span>+<span style="color: #cc66cc;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span> |</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+<span style="color: #808080; font-style: italic;">--------------------------+</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;color:#800000;">0</span> |</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+<span style="color: #808080; font-style: italic;">--------------------------+</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc66cc;color:#800000;">1</span> row <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">18</span>.<span style="color: #cc66cc;color:#800000;">89</span> sec<span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>As you can see this is hell a lot of difference !</p>
<p>Depending on your application performance with single thread may be important or non important for you - it is surely important for the slave if you're having active replication, if you're running time sensitive long running CPU bound queries or if queries contribute significant time to generating web page.</p>
<p>For example if on Xeon queries take  50ms  to generate the page, the MySQL Latency you may see on T2000 may be as high as 500ms  which would be well above performance guidelines for many web applications. </p>
<p>I'm hearing Sun is working on new CPUs which would offer significantly higher single thread performance, but at this time I have to be very careful advising this platform to the customers.</p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by peter |
      <a href="http://www.mysqlperformanceblog.com/2008/05/01/t2000-cpu-performance-watch-out/#comments">12 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2008/05/01/t2000-cpu-performance-watch-out/&amp;title=T2000 CPU Performance &#8211; Watch out" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2008/05/01/t2000-cpu-performance-watch-out/&amp;title=T2000 CPU Performance &#8211; Watch out" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2008/05/01/t2000-cpu-performance-watch-out/&amp;title=T2000 CPU Performance &#8211; Watch out" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2008/05/01/t2000-cpu-performance-watch-out/&amp;T=T2000 CPU Performance &#8211; Watch out" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2008/05/01/t2000-cpu-performance-watch-out/&amp;title=T2000 CPU Performance &#8211; Watch out" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2008/05/01/t2000-cpu-performance-watch-out/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>MySQL Performance on Memory Appliance</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/31/mysql-performance-on-memory-appliance/</link>
		<comments>http://www.mysqlperformanceblog.com/2008/03/31/mysql-performance-on-memory-appliance/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 04:43:42 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Innodb]]></category>
		<category><![CDATA[benchmarks]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[myisam]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/31/mysql-performance-on-memory-appliance/</guid>
		<description><![CDATA[Recently I have had a chance to check out MySQL Performance on "Memory Appliance" by Violin Memory which can be used as extremely high speed storage system.
I helped Violin Memory to optimize MySQL for customer workload and Violin memory and also had a chance to do some benchmarks on my own.   2*Quad Core [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have had a chance to check out MySQL Performance on "Memory Appliance" by <a href="http://www.violin-memory.com/">Violin Memory</a> which can be used as extremely high speed storage system.</p>
<p>I helped Violin Memory to optimize MySQL for customer workload and Violin memory and also had a chance to do some benchmarks on my own.   2*Quad Core Xeon  running CentOS5 was tested using ext2 filesystem and SysBench tool. </p>
<p>Using 16K  read sizes (matches Innodb page size)  I could get 1.2GB/sec  (80K req/sec) for reads and about 500MB/sec writes with 16 concurrent threads.    Things scaled well and with 256 threads I got even a bit better performance. </p>
<p>Interesting enough utilization  in iostat never went over few percents and load was mostly CPU bound. </p>
<p>Next I went on testing MySQL.  My goal was to simulate as much IO as possible so I use  <a href="http://sourceforge.net/projects/sysbench">Sysbench</a> to get 300Mil rows table and ran primary key lookups with uniform distribution some 90% of which  would  need to do IO to get their data from the disk.</p>
<p>With <strong>Innodb</strong>  results were quite poor  - I got about <strong>6500 req/sec</strong>  from one thread  which grew to <strong>13000 req/sec</strong> when 8 concurrent threads were used.   Compare this to  <strong>20.000 queries/sec</strong> from single thread if all data fits to bugger pool, scaling to over 80.000 queries/sec with multiple threads. </p>
<p>So Innodb took very high hit supplied with high performance IO subsystem.  But not only performance was poor with single thread it also did not scale well with increased concurrency   even though we had 8 cores available for disposal. </p>
<p>Unfortunately oprofile did not work on the box in question so I could not investigate where exactly CPU is wasted.   My first obvious quess was Innodb checksumming  (<strong>innodb_checksums=0</strong>) and indeed that allowed to get to <strong>9000 queries/sec</strong>  from single thread, however it still peaked out at <strong>13.500 queries/sec </strong> with multiple threads which corresponds to even worse scalability.  Disabling adaptive hash index could take us to <strong>14.500 req/sec</strong> which was also a bit surprising as we're speaking about read-only workload so it is quite surprising adaptive hash index actually hurts performance in this case. </p>
<p>My guess is Innodb just was not really designed and tested in such condition - normal case is to allocate cache memory to buffer pool so IOs will mostly come from drives directly which means hundreds or may be thousands of IOs per system for the whole system which allows to waste some CPU cycles handling them without taking large performance hit. </p>
<p>I really hope this would be one of the Items besides CPU scaling which Innodb team will put on their roadmap.  With SSD coming  this will be important.   And it is also very easy to repeat and test - just run Innodb from the RAM drive <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>Next I tested <strong>MyISAM</strong> which is well known for its simplicity and so fast execution path from getting data from the drive and sending it back to the client. </p>
<p>I tested MyISAM with <strong>myisam_use_mmap</strong> option which did not seems to give any significant performance benefit, may be even reducing performance few percents.  I also tried running with key buffer on and off.  Interesting enough disabling key buffer actually worked better for this workload avoiding to avoid contention.</p>
<p>In the best conditions I got about <strong>13.5K queries/sec</strong> from MyISAM  (double of Innodb already)  which scaled to <strong>70.000  queries/sec</strong> peaking out at 16 threads.  </p>
<p>However even with MyISAM we got CPU bound before we could reach the system capacity - these 70K queries/sec generated just over 50K  IOs/sec   while  capacity was over 100K  IOs/sec  (more than with Innodb as these are smaller sized) </p>
<p>These results reiterate one important things about Innodb - it just loves to have as much data in buffer pool as possible for best performance. </p>
<p>Hopefully some time in the future I get a chance to do more testing with this nice hardware and may be check out other storage engines and other workloads or get some profiling results. </p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by peter |
      <a href="http://www.mysqlperformanceblog.com/2008/03/31/mysql-performance-on-memory-appliance/#comments">21 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2008/03/31/mysql-performance-on-memory-appliance/&amp;title=MySQL Performance on Memory Appliance" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2008/03/31/mysql-performance-on-memory-appliance/&amp;title=MySQL Performance on Memory Appliance" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2008/03/31/mysql-performance-on-memory-appliance/&amp;title=MySQL Performance on Memory Appliance" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2008/03/31/mysql-performance-on-memory-appliance/&amp;T=MySQL Performance on Memory Appliance" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2008/03/31/mysql-performance-on-memory-appliance/&amp;title=MySQL Performance on Memory Appliance" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2008/03/31/mysql-performance-on-memory-appliance/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Big Iron for tests anyone ?</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/20/big-iron-for-tests-anyone/</link>
		<comments>http://www.mysqlperformanceblog.com/2008/03/20/big-iron-for-tests-anyone/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 05:44:22 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[community]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/20/big-iron-for-tests-anyone/</guid>
		<description><![CDATA[MySQL Users Conference is coming and with  it my presentation about Innodb Scalability limits.   We did bunch of tests but we surely could get benefit of some extra hardware for testing, so if you could provide us with dedicated remote access  for benchmarks it would be great. 
Here is what we're [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL Users Conference is coming and with  it my presentation about Innodb Scalability limits.   We did bunch of tests but we surely could get benefit of some extra hardware for testing, so if you could provide us with dedicated remote access  for benchmarks it would be great. </p>
<p>Here is what we're looking for in particular:</p>
<p>   - More than Dual Core Opteron systems. Would be good to see how they scale<br />
   - More than 8 core systems<br />
   - Non x86 based systems (Niagara etc)<br />
   - Fancy IO subsystem - more than 8 hard  drives<br />
   - SSD based storage. </p>
<p>If you have something of this sort available let me know. </p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by peter |
      <a href="http://www.mysqlperformanceblog.com/2008/03/20/big-iron-for-tests-anyone/#comments">10 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2008/03/20/big-iron-for-tests-anyone/&amp;title=Big Iron for tests anyone ?" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2008/03/20/big-iron-for-tests-anyone/&amp;title=Big Iron for tests anyone ?" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2008/03/20/big-iron-for-tests-anyone/&amp;title=Big Iron for tests anyone ?" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2008/03/20/big-iron-for-tests-anyone/&amp;T=Big Iron for tests anyone ?" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2008/03/20/big-iron-for-tests-anyone/&amp;title=Big Iron for tests anyone ?" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2008/03/20/big-iron-for-tests-anyone/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Evaluating IO subsystem performance for MySQL Needs</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/05/evaluating-io-subsystem-performance-for-mysql-needs/</link>
		<comments>http://www.mysqlperformanceblog.com/2008/03/05/evaluating-io-subsystem-performance-for-mysql-needs/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 07:55:01 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[benchmarks]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/05/evaluating-io-subsystem-performance-for-mysql-needs/</guid>
		<description><![CDATA[I'm often asked how one can evaluate IO subsystem (Hard drive RAID or SAN) performance for MySQL needs so I've decided to write  some simple steps you can take to get a good feeling about it, it is not perfect but usually can tell you quite a lot of what you should expect from [...]]]></description>
			<content:encoded><![CDATA[<p>I'm often asked how one can evaluate IO subsystem (Hard drive RAID or SAN) performance for MySQL needs so I've decided to write  some simple steps you can take to get a good feeling about it, it is not perfect but usually can tell you quite a lot of what you should expect from the system. </p>
<p>What I usually look for MySQL is  performance in random reads and random writes.  Sequential reads and writes are rarely the problem for OLTP workloads, so we will not look at them. </p>
<p>I also prefer to look at performance with O_DIRECT flag set to bypass OS cache. This may execute separate code path in kernel and so has a bit different performance pattern compared to buffered IO (even followed by fsync regularly) , but it allows to easily bypass OS cache both for reads and for writes and so does not require creating large working sets for boxes with significant amounts of memory (or reducing amount of usable memory).</p>
<p>The system I'm testing this on has 256MB BBU (Battery Backed up Cache) on RAID controller so we will test two workloads size - first one is small which fits in the cache and the second one will be large enough so it does not.   This allows us to see both by RAID cache and uncached IO performance.   </p>
<p>We're interested in cached reads because they may show latency to the RAID cache  if RAID read cache is enabled.  If it is disabled you may be reading from Drives cache or even drives themselves which will affect performance significantly.  In any case especially playing with data size a bit you will well learn how your cache behaves.</p>
<p>Were  even more so interested about writes which show us how many cached writes per second we can do -  this is important for log writes, which are synchronous IO operation database performance which typically have rather close data locality. </p>
<p>We're also interested in uncached reads and writes because this correspond to general database workload. </p>
<p>It is worth to run the test with 1 thread and with some higher number (say 64) to see how things scale.    </p>
<p>The tool I'm using for this is <a href="http://sourceforge.net/projects/sysbench">SysBench</a> which was designed by my team when I still worked for MySQL and we specially implemented bunch of tests to ease hardware evaluation for things which are important for MySQL. </p>
<p>To prepare small 128MB single file working set we can use the following command:</p>
<div class="igBar"><span id="lcode-14"><a href="#" onclick="javascript:showPlainTxt('code-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-14">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>root@DB10 sysbench<span style="color:#006600; font-weight:bold;">&#93;</span># ./sysbench --test=fileio --max-time=<span style="color:#800000;color:#800000;">60</span> --max-requests=<span style="color:#800000;color:#800000;">1000000</span>&nbsp; --file-num=<span style="color:#800000;color:#800000;">1</span> --file-extra-flags=direct --file-fsync-freq=<span style="color:#800000;color:#800000;">0</span>&nbsp; --file-total-size=128M prepare </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And when we can run the test:</p>
<div class="igBar"><span id="lcode-15"><a href="#" onclick="javascript:showPlainTxt('code-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-15">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">./sysbench --test=fileio --max-time=<span style="color:#800000;color:#800000;">60</span> --max-requests=<span style="color:#800000;color:#800000;">1000000</span>&nbsp; --file-num=<span style="color:#800000;color:#800000;">1</span> --file-extra-flags=direct --file-fsync-freq=<span style="color:#800000;color:#800000;">0</span>&nbsp; --file-total-size=128M --file-test-mode=rndrd run</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sysbench v0.<span style="color:#800000;color:#800000;">4</span>.<span style="color:#800000;color:#800000;">8</span>:&nbsp; multi-threaded system evaluation benchmark</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Running the test with following options:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Number of threads: <span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Extra file open flags: <span style="color:#800000;color:#800000;">16384</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">1</span> files, 128Mb each</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">128Mb total file size</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Block size 16Kb</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Number of random requests for random IO: <span style="color:#800000;color:#800000;">1000000</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Read/Write ratio for combined random IO test: <span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">50</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Calling fsync<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> at the end of test, Enabled.</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">Using</span> synchronous I/O mode</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Doing random read test</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Threads started!</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Time limit exceeded, exiting...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">Done</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">Operations</span> performed:&nbsp; <span style="color:#800000;color:#800000;">773835</span> Read, <span style="color:#800000;color:#800000;">0</span> Write, <span style="color:#800000;color:#800000;">0</span> Other = <span style="color:#800000;color:#800000;">773835</span> Total</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Read <span style="color:#800000;color:#800000;">11</span>.808Gb&nbsp; Written 0b&nbsp; Total transferred <span style="color:#800000;color:#800000;">11</span>.808Gb&nbsp; <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">201</span>.52Mb/sec<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">12897</span>.<span style="color:#800000;color:#800000;">22</span> Requests/sec executed</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Test execution summary:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; total time:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">60</span>.0001s</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; total number of events:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">773835</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; total time taken by event execution: <span style="color:#800000;color:#800000;">59</span>.<span style="color:#800000;color:#800000;">0285</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; per-request statistics:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;min:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.0001s</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;avg:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.0001s</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;max:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.0086s</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;approx.&nbsp; <span style="color:#800000;color:#800000;">95</span> percentile:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>.0001s</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Threads fairness:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; events <span style="color:#006600; font-weight:bold;">&#40;</span>avg/stddev<span style="color:#006600; font-weight:bold;">&#41;</span>:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">773835</span>.<span style="color:#800000;color:#800000;">0000</span>/<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">00</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; execution time <span style="color:#006600; font-weight:bold;">&#40;</span>avg/stddev<span style="color:#006600; font-weight:bold;">&#41;</span>:&nbsp; &nbsp;<span style="color:#800000;color:#800000;">59</span>.<span style="color:#800000;color:#800000;">0285</span>/<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">00</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The output is pretty verbose so it is quite scary for many people, however there is basically one number important here  <strong>12897.22 req/sec</strong>   - so the RAID cache on this drive can do about 13.000 16K reads/sec from the cache, not bad at all.</p>
<p>With 64 threads I get   <strong>23727.46 req/sec</strong>  which shows even in such cached mode you can get better performance by having many outstanding requests. </p>
<p>Running with more than one threads you may also take a look at another table SysBench displays:</p>
<div class="igBar"><span id="lcode-16"><a href="#" onclick="javascript:showPlainTxt('code-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-16">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">per-request statistics:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;min:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.0008s</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;avg:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.0027s</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;max:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.0112s</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;approx.&nbsp; <span style="color:#800000;color:#800000;">95</span> percentile:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>.0030s </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>So we get about 3ms   95 percentile request time - not bad - all request were executed with pretty uniform performance.</p>
<p>Let us now do the test with single thread and write-through RAID cache (as if there would not be any BBU)</p>
<div class="igBar"><span id="lcode-17"><a href="#" onclick="javascript:showPlainTxt('code-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-17">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>root@DB10 sysbench<span style="color:#006600; font-weight:bold;">&#93;</span># ./sysbench --test=fileio --max-time=<span style="color:#800000;color:#800000;">60</span> --max-requests=<span style="color:#800000;color:#800000;">1000000</span>&nbsp; --file-num=<span style="color:#800000;color:#800000;">1</span> --file-extra-flags=direct --file-fsync-freq=<span style="color:#800000;color:#800000;">0</span>&nbsp; --file-total-size=128M --num-threads=<span style="color:#800000;color:#800000;">1</span> --file-test-mode=rndwr run</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sysbench v0.<span style="color:#800000;color:#800000;">4</span>.<span style="color:#800000;color:#800000;">8</span>:&nbsp; multi-threaded system evaluation benchmark </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Auch... We get <strong>142.62 Requests/sec</strong> which is extremely poor considering this is 8 drives array.  You would likely get a bit better with sequential log writes but  it is not going to be much higher. </p>
<p>Lets see what we get with 64 threads...  hm again <strong>142.83 Requests/sec</strong> and looking at VMSTAT I can see only 1 blocked process all the time which does not sounds right. </p>
<p>Honestly I did not expect this result while running benchmarks for this articles (and this is always very exciting to find something unexpected while doing Benchmarks).   Fortunately I've already seen this some time ago though I hoped this issue is long fixed since that time... Though this box is running CentOS4 which is not the newest OS out where. </p>
<p>The problem is basically in case of O_DIRECT writes there is only one IO can be happening per file at any given time.  To show this is the problem let us create working set consisting out of number of files and repeat the run:</p>
<div class="igBar"><span id="lcode-18"><a href="#" onclick="javascript:showPlainTxt('code-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-18">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>root@DB10 sysbench<span style="color:#006600; font-weight:bold;">&#93;</span># ./sysbench --test=fileio --max-time=<span style="color:#800000;color:#800000;">60</span> --max-requests=<span style="color:#800000;color:#800000;">1000000</span>&nbsp; --file-num=<span style="color:#800000;color:#800000;">128</span> --file-extra-flags=direct --file-fsync-freq=<span style="color:#800000;color:#800000;">0</span>&nbsp; --file-total-size=128M --num-threads=<span style="color:#800000;color:#800000;">64</span> --file-test-mode=rndwr cleanup</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sysbench v0.<span style="color:#800000;color:#800000;">4</span>.<span style="color:#800000;color:#800000;">8</span>:&nbsp; multi-threaded system evaluation benchmark</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Removing test files...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>root@DB10 sysbench<span style="color:#006600; font-weight:bold;">&#93;</span># ./sysbench --test=fileio --max-time=<span style="color:#800000;color:#800000;">60</span> --max-requests=<span style="color:#800000;color:#800000;">1000000</span>&nbsp; --file-num=<span style="color:#800000;color:#800000;">128</span> --file-extra-flags=direct --file-fsync-freq=<span style="color:#800000;color:#800000;">0</span>&nbsp; --file-total-size=128M --num-threads=<span style="color:#800000;color:#800000;">64</span> --file-test-mode=rndwr prepare</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sysbench v0.<span style="color:#800000;color:#800000;">4</span>.<span style="color:#800000;color:#800000;">8</span>:&nbsp; multi-threaded system evaluation benchmark</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">128</span> files, 1024Kb each, 128Mb total</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Creating files for the test...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>root@DB10 sysbench<span style="color:#006600; font-weight:bold;">&#93;</span># ./sysbench --test=fileio --max-time=<span style="color:#800000;color:#800000;">60</span> --max-requests=<span style="color:#800000;color:#800000;">1000000</span>&nbsp; --file-num=<span style="color:#800000;color:#800000;">128</span> --file-extra-flags=direct --file-fsync-freq=<span style="color:#800000;color:#800000;">0</span>&nbsp; --file-total-size=128M --num-threads=<span style="color:#800000;color:#800000;">64</span> --file-test-mode=rndwr run </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now we get  <strong>827.94 Requests/sec</strong>  requests per second, which is not bad considering this is RAID5 volume.</p>
<p>Let us now repeat the tests for WriteBack cache configuration:</p>
<p>We get <strong>4735.27 Requests/sec</strong> from 1 thread and single file; <strong>4740.19 Requests/sec</strong>  from 64 threads and 1 file and  <strong>5228.68 Requests/sec</strong> with 64 threads and 128 files.</p>
<p>As you can see numbers are a lot better especially when there is single thread doing IO (just as with database log).  We can see serialization with O_DIRECT however the impact is much less in this case compared to Write Through mode because we're mostly limited by RAID controller capacity. </p>
<p>Let us now do test with larger test set. We'll use <strong>2GB in 128 files </strong>(because we already discovered synchronization issue with O_DIRECT).  This sounds small but as controller cache is just 256M it should be good enough.</p>
<div class="igBar"><span id="lcode-19"><a href="#" onclick="javascript:showPlainTxt('code-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-19">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>root@DB10 sysbench<span style="color:#006600; font-weight:bold;">&#93;</span># ./sysbench --test=fileio --max-time=<span style="color:#800000;color:#800000;">60</span> --max-requests=<span style="color:#800000;color:#800000;">1000000</span>&nbsp; --file-num=<span style="color:#800000;color:#800000;">1</span> --file-extra-flags=direct --file-fsync-freq=<span style="color:#800000;color:#800000;">0</span>&nbsp; --file-total-size=128M --num-threads=<span style="color:#800000;color:#800000;">64</span> --file-test-mode=rndwr cleanup</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sysbench v0.<span style="color:#800000;color:#800000;">4</span>.<span style="color:#800000;color:#800000;">8</span>:&nbsp; multi-threaded system evaluation benchmark</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Removing test files...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>root@DB10 sysbench<span style="color:#006600; font-weight:bold;">&#93;</span># ./sysbench --test=fileio --max-time=<span style="color:#800000;color:#800000;">60</span> --max-requests=<span style="color:#800000;color:#800000;">1000000</span>&nbsp; --file-num=<span style="color:#800000;color:#800000;">128</span> --file-extra-flags=direct --file-fsync-freq=<span style="color:#800000;color:#800000;">0</span>&nbsp; --file-total-size=2G --num-threads=<span style="color:#800000;color:#800000;">1</span> --file-test-mode=rndwr prepare</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sysbench v0.<span style="color:#800000;color:#800000;">4</span>.<span style="color:#800000;color:#800000;">8</span>:&nbsp; multi-threaded system evaluation benchmark </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>There is also one trick running such larger scale benchmarks.  SysBench by default has repeatable sequence of requests, because it does not initialize random generator. If you're doing multiple runs make sure to add <strong>--init-rng=1</strong> option otherwise results can be skewed.</p>
<p>So we do run as:</p>
<div class="igBar"><span id="lcode-20"><a href="#" onclick="javascript:showPlainTxt('code-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-20">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>root@DB10 sysbench<span style="color:#006600; font-weight:bold;">&#93;</span># ./sysbench --init-rng=<span style="color:#800000;color:#800000;">1</span> --test=fileio --max-time=<span style="color:#800000;color:#800000;">60</span> --max-requests=<span style="color:#800000;color:#800000;">1000000</span>&nbsp; --file-num=<span style="color:#800000;color:#800000;">128</span> --file-extra-flags=direct --file-fsync-freq=<span style="color:#800000;color:#800000;">0</span>&nbsp; --file-total-size=2G --num-threads=<span style="color:#800000;color:#800000;">1</span> --file-test-mode=rndrd run </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>For single thread we get <strong>259.28 Requests/sec</strong> which approximately matches what single drive can do.  This is important lesson - even if you have many hard drives you can't really get advantage of them unless you can get multiple outstanding requests. </p>
<p>Performance with 64 threads was <strong>2334.63 Requests/sec</strong> which is perfect scalability to 6 hard drive this array has. We have even a bit more than 8x because 64 outstanding requests allow RAID controller to optimize seeks.</p>
<p>Lets us see how writes are doing:</p>
<p>For writes we're getting <strong>583.43 Requests/sec</strong>  for 1 thread and  <strong>605.88 Requests/sec</strong> for 64 threads.</p>
<p>As you can see we got more writes for single thread than we had reads and also using multiple threads for writes did not improve performance as dramatically as for reads. This is because as we have BBU writes are just stored in controller cache and flushed to the disk in background - in this case there is little difference if we use one thread or multiple threads. </p>
<p>As you also can see BBU is helpful even for random writes if they are performed from single thread - so it does not only help database log writes but has much larger positive impact on workload.</p>
<p>I should also note it is very good idea to watch VMSTAT while doing the test.  Here is the snipped from good VMSTAT from the read test:</p>
<div class="igBar"><span id="lcode-21"><a href="#" onclick="javascript:showPlainTxt('code-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-21">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">64</span>&nbsp; <span style="color:#800000;color:#800000;">90560</span> <span style="color:#800000;color:#800000;">3196492</span>&nbsp; <span style="color:#800000;color:#800000;">86832</span> <span style="color:#800000;color:#800000;">12631072</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">37760</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">23</span> <span style="color:#800000;color:#800000;">3402</span>&nbsp; <span style="color:#800000;color:#800000;">6932</span>&nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">12</span> <span style="color:#800000;color:#800000;">64</span> <span style="color:#800000;color:#800000;">24</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">64</span>&nbsp; <span style="color:#800000;color:#800000;">90560</span> <span style="color:#800000;color:#800000;">3196500</span>&nbsp; <span style="color:#800000;color:#800000;">86836</span> <span style="color:#800000;color:#800000;">12631068</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">37222</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">26</span> <span style="color:#800000;color:#800000;">3328</span>&nbsp; <span style="color:#800000;color:#800000;">7694</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">1</span> <span style="color:#800000;color:#800000;">75</span> <span style="color:#800000;color:#800000;">24</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">64</span>&nbsp; <span style="color:#800000;color:#800000;">90560</span> <span style="color:#800000;color:#800000;">3196436</span>&nbsp; <span style="color:#800000;color:#800000;">86836</span> <span style="color:#800000;color:#800000;">12631068</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">36998</span>&nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">6</span> <span style="color:#800000;color:#800000;">3340</span>&nbsp; <span style="color:#800000;color:#800000;">7716</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">1</span> <span style="color:#800000;color:#800000;">74</span> <span style="color:#800000;color:#800000;">24</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">64</span>&nbsp; <span style="color:#800000;color:#800000;">90560</span> <span style="color:#800000;color:#800000;">3196428</span>&nbsp; <span style="color:#800000;color:#800000;">86840</span> <span style="color:#800000;color:#800000;">12631064</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">37395</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">12</span> <span style="color:#800000;color:#800000;">3320</span>&nbsp; <span style="color:#800000;color:#800000;">7774</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">1</span> <span style="color:#800000;color:#800000;">74</span> <span style="color:#800000;color:#800000;">24</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">64</span>&nbsp; <span style="color:#800000;color:#800000;">90560</span> <span style="color:#800000;color:#800000;">3196436</span>&nbsp; <span style="color:#800000;color:#800000;">86840</span> <span style="color:#800000;color:#800000;">12631064</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">37498</span>&nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">6</span> <span style="color:#800000;color:#800000;">3365</span>&nbsp; <span style="color:#800000;color:#800000;">7758</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">1</span> <span style="color:#800000;color:#800000;">74</span> <span style="color:#800000;color:#800000;">24</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">64</span>&nbsp; <span style="color:#800000;color:#800000;">90560</span> <span style="color:#800000;color:#800000;">3196436</span>&nbsp; <span style="color:#800000;color:#800000;">86840</span> <span style="color:#800000;color:#800000;">12631064</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">37702</span>&nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">6</span> <span style="color:#800000;color:#800000;">3370</span>&nbsp; <span style="color:#800000;color:#800000;">7680</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">2</span> <span style="color:#800000;color:#800000;">74</span> <span style="color:#800000;color:#800000;">24</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p> </p>
<p>As you can see all 64 threads are waiting for IO.  Now lest see our write test which seems to have some serialization issues</p>
<div class="igBar"><span id="lcode-22"><a href="#" onclick="javascript:showPlainTxt('code-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-22">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">2</span> <span style="color:#800000;color:#800000;">39</span>&nbsp; <span style="color:#800000;color:#800000;">90560</span> <span style="color:#800000;color:#800000;">5305556</span>&nbsp; <span style="color:#800000;color:#800000;">86920</span> <span style="color:#800000;color:#800000;">10534204</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">9345</span> <span style="color:#800000;color:#800000;">1625</span>&nbsp; <span style="color:#800000;color:#800000;">4587</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">70</span> <span style="color:#800000;color:#800000;">30</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">1</span>&nbsp; <span style="color:#800000;color:#800000;">1</span>&nbsp; <span style="color:#800000;color:#800000;">90560</span> <span style="color:#800000;color:#800000;">5305548</span>&nbsp; <span style="color:#800000;color:#800000;">86920</span> <span style="color:#800000;color:#800000;">10534204</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">9017</span> <span style="color:#800000;color:#800000;">1661</span>&nbsp; <span style="color:#800000;color:#800000;">4934</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">74</span> <span style="color:#800000;color:#800000;">26</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">1</span>&nbsp; <span style="color:#800000;color:#800000;">1</span>&nbsp; <span style="color:#800000;color:#800000;">90560</span> <span style="color:#800000;color:#800000;">5305556</span>&nbsp; <span style="color:#800000;color:#800000;">86924</span> <span style="color:#800000;color:#800000;">10534200</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">9223</span> <span style="color:#800000;color:#800000;">1638</span>&nbsp; <span style="color:#800000;color:#800000;">4881</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">73</span> <span style="color:#800000;color:#800000;">27</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">1</span>&nbsp; <span style="color:#800000;color:#800000;">3</span>&nbsp; <span style="color:#800000;color:#800000;">90560</span> <span style="color:#800000;color:#800000;">5305556</span>&nbsp; <span style="color:#800000;color:#800000;">86932</span> <span style="color:#800000;color:#800000;">10534192</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">9634</span> <span style="color:#800000;color:#800000;">1715</span>&nbsp; <span style="color:#800000;color:#800000;">5033</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">74</span> <span style="color:#800000;color:#800000;">26</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">1</span>&nbsp; <span style="color:#800000;color:#800000;">1</span>&nbsp; <span style="color:#800000;color:#800000;">90560</span> <span style="color:#800000;color:#800000;">5305556</span>&nbsp; <span style="color:#800000;color:#800000;">86932</span> <span style="color:#800000;color:#800000;">10534192</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">9235</span> <span style="color:#800000;color:#800000;">1643</span>&nbsp; <span style="color:#800000;color:#800000;">5035</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">73</span> <span style="color:#800000;color:#800000;">26</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>You can get similar information by analyzing <strong>iostat </strong> numbers and that well may be more accurate. Though looking at VMSTAT is often good enough to see the problem. </p>
<p>P.S If you're wondering which hardware I used for benchmarks - it is Dell PowerEdge 2950 with PERC5 and 6 10K RPM hard drives in RAID5.</p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by peter |
      <a href="http://www.mysqlperformanceblog.com/2008/03/05/evaluating-io-subsystem-performance-for-mysql-needs/#comments">18 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2008/03/05/evaluating-io-subsystem-performance-for-mysql-needs/&amp;title=Evaluating IO subsystem performance for MySQL Needs" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2008/03/05/evaluating-io-subsystem-performance-for-mysql-needs/&amp;title=Evaluating IO subsystem performance for MySQL Needs" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2008/03/05/evaluating-io-subsystem-performance-for-mysql-needs/&amp;title=Evaluating IO subsystem performance for MySQL Needs" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2008/03/05/evaluating-io-subsystem-performance-for-mysql-needs/&amp;T=Evaluating IO subsystem performance for MySQL Needs" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2008/03/05/evaluating-io-subsystem-performance-for-mysql-needs/&amp;title=Evaluating IO subsystem performance for MySQL Needs" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2008/03/05/evaluating-io-subsystem-performance-for-mysql-needs/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>RAID System performance surprises</title>
		<link>http://www.mysqlperformanceblog.com/2008/03/05/raid-system-performance-surprises/</link>
		<comments>http://www.mysqlperformanceblog.com/2008/03/05/raid-system-performance-surprises/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 07:21:11 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/03/05/raid-system-performance-surprises/</guid>
		<description><![CDATA[Implementing MySQL database in 24/7 environments we typically hope for uniform component performance, or at least would like to be able to control it. Typically this is indeed the case, for example CPU will perform with same performance day and night (unless system management software decides to lower CPU frequency due to overheating). 
This is [...]]]></description>
			<content:encoded><![CDATA[<p>Implementing MySQL database in 24/7 environments we typically hope for uniform component performance, or at least would like to be able to control it. Typically this is indeed the case, for example CPU will perform with same performance day and night (unless system management software decides to lower CPU frequency due to overheating). </p>
<p>This is also almost the case with Hard Drives - there are possible performance differences based on where data is stored on the disk, amount of remapped sectors etc.  There is also database and file system fragmentation however these also tend to accumulate in predictable fashion. </p>
<p>If you have RAID controller this well may not be the case - to protect your data RAID controller may implement bunch of algorithms which can affect performance dramatically. </p>
<p>For example speaking about PERC5 (LSI MegaRaid) - Pretty typical controller from Dell installed on PowerEdge 1950, 2950 etc you should be aware of  couple of things </p>
<p><strong>Battery Learning and Charging </strong>  Build in Battery has to pass through learning cycle every 3 months or so and this cycle takes about 7 hours according to the <a href="http://support.ap.dell.com/support/edocs/storage/RAID/PERC5/en/UG/HTML/chapterb.htm">docs</a>. During this time battery backed up cache will be disabled and system will operate with write through cache possibly slowing down write performance several times. </p>
<p><strong>Patrol Read </strong>  This is feature which should discover bad sectors before it is too late and it is doing so by doing disk read checks periodically.  When it wakes up it will some IO resources (30% by default) which will affect your performance some way.</p>
<p><strong>Consistency Checks</strong>  This is another thing which I've seen initiated by controller (though I'm not sure on this one) - which pretty much checks the disks are in sync - this also can slow down performance dramatically. </p>
<p><strong>So what you can do about these ?</strong></p>
<p>First you should not have any of this to come as surprise for you when you discovered your server just stopped performance during the time you planned investor show case or other important event.   Learn what  cron jobs does your RAID card have and see how they can be controlled - may be schedule them during least busy intervals or something similar.</p>
<p>Also you should be ready for degraded and rebuild RAID mode - when one of the disk fails and you replace it with another one which needs to be rebuilt. This means you already should leave some slack of the system.  It often would be enough for consistency check and patrol read but  not for battery backed up cache being temporary disabled. </p>
<p>Another thing you can do is of course switch to another server and take this down for maintenance if this learning process can't be scheduled when it is non intrusive.  To do this properly however you need to know when it is about to happen.</p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by peter |
      <a href="http://www.mysqlperformanceblog.com/2008/03/05/raid-system-performance-surprises/#comments">6 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2008/03/05/raid-system-performance-surprises/&amp;title=RAID System performance surprises" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2008/03/05/raid-system-performance-surprises/&amp;title=RAID System performance surprises" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2008/03/05/raid-system-performance-surprises/&amp;title=RAID System performance surprises" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2008/03/05/raid-system-performance-surprises/&amp;T=RAID System performance surprises" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2008/03/05/raid-system-performance-surprises/&amp;title=RAID System performance surprises" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2008/03/05/raid-system-performance-surprises/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
