<?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>Weez.com &#187; performance</title>
	<atom:link href="http://www.weez.com/tag/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.weez.com</link>
	<description>Solving everyday practical LAMP problems... one at a time</description>
	<lastBuildDate>Sun, 05 Feb 2012 03:28:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MySQL Performance Blog: linux.conf.au 2012 roundup</title>
		<link>http://www.weez.com/2012/01/mysql-performance-blog-linux-conf-au-2012-roundup/</link>
		<comments>http://www.weez.com/2012/01/mysql-performance-blog-linux-conf-au-2012-roundup/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 20:07:44 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[linux.conf.au]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[roundup]]></category>

		<guid isPermaLink="false">http://www.weez.com/2012/01/mysql-performance-blog-linux-conf-au-2012-roundup/</guid>
		<description><![CDATA[I spent last week at linux.conf.au in Ballarat, Victoria (that&#8217;s the Victoria in Australia, not wherever else there may be one) which is only a pleasant two hour drive from my home town of Melbourne (Australia, not Florida). I sent an email internally to our experts detailing bits of the conference that may interest them [...]]]></description>
			<content:encoded><![CDATA[<p>I spent last week at linux.conf.au in Ballarat, Victoria (that&#8217;s the Victoria in Australia, not wherever else there may be one) which is only a pleasant two hour drive from my home town of Melbourne (Australia, not Florida). I sent an email internally to our experts detailing bits of the conference that may interest them &#8211; and I thought that it may also interest our wider readers who are interested in all levels of the software stack.</p>
<p>For those that don&#8217;t know: <a href="http://linux.conf.au">linux.conf.au</a> is one of (if not the) most awesome technical conference in the free software space. It consistently attracts a wide variety of very knowledgable speakers and a large number of attendees.</p>
<p>Every year it is put together by a (different) set of volunteers, and this means it also tours around the country (and sometimes even New Zealand). This year it was in Ballarat &#8211; a regional city a couple of hours drive out of Melbourne. One of the great things about LCA is that you are not always at the same hotel, in the same city stuck with the same two restaurants.</p>
<p>This year had a bit of an increased focus on privacy, security and basic freedoms and human rights. This is no doubt a reaction to the increased attacks on freedom of speech and the internet that have been going on in recent months.</p>
<p>That being said, there were a huge number of great talks on a variety of topics &#8211; everything from filesystem performance to open hardware, to repurposing existing hardware to upcoming challenges for the kernel to howto be a better sysadmin. In fact&#8230; for those who weren&#8217;t there and spend any of their life helping people admin machines &#8211; go and watch those talks.</p>
<p>linux.conf.au (for me) is one of the cannot-miss events in the year. It&#8217;s an opportunity to learn things that directly apply to my work, may apply in the future and most certainly will never apply but are rather cool anyway.</p>
<p>All the video from the conference are already up! This is an amazing effort from the (volunteer) AV team. I&#8217;ve included links to a selection of talks below that I especially think are worth watching:</p>
<p><strong>Watch no matter what:</strong></p>
<ul>
<li><a href="http://www.youtube.com/watch?v=5XDTQLa3NjE">Keynote &#8211; Karen Sandler</a><br />
This keynote was amazing. Go watch it. The organisers did a truly excellent job at selecting keynotes this year.</li>
<li><a href="http://www.youtube.com/watch?v=GMN2360LM_U">Keynote &#8211; Jacob Appelbaum</a><br />
This is best described as a tour of internet freedom, the attacks on it and a tour of the modern surveillance state.</li>
<li><a href="http://www.youtube.com/watch?v=V2aq5M3Q76U">UEFI and Linux: The future is here and it&#8217;s awful</a><br />
You will be depressed at some point in this talk &#8211; the news is not great for the future of even being able to easily boot free software on machines.</li>
<li><a href="http://www.youtube.com/watch?v=KV1iUmDVsM4">Paul Fenwick&#8217;s Keynote</a><br />
A good quick introduction to hacking your brain. I&#8217;m sure many of you (like me) are interested in ways to hack our brains and our bodies to better serve us. This talk is merely an introduction. I also suggest you check out <a href="http://ankisrs.net/">Anki</a> if you want to improve your ability to remember things.</li>
<li><a href="http://www.youtube.com/watch?v=xKBlB8tejjI">Torturing OpenSSL</a><br />
This was certainly one of the most amazing talks I saw. A whole new interesting way of attacking SSL. Vary CPU voltage, extract private SSL keys! Wheee!</li>
<li><a href="http://www.youtube.com/watch?v=elRCAD3sPEk">The Kernel Report &#8211; Jonathan Corbet</a><br />
You can skip this only if you read every single mail on LKML, run your own analysis on the kernel source tree and publish an (at least) weekly publication on Linux.<br />
This is one of the few (err&#8230; only) talks that is repeatedly accepted into linux.conf.au. Why? Because Jon manages to compress a whole year of activity in the Linux world int oa single session that is incredibly informative.</li>
<li><a href="http://www.youtube.com/watch?v=hxWuaozpe2I">I Can&#8217;t Believe This Is Butter! A tour of BTRFS</a><br />
This is going to be the default filesystem in a number of places over the next few years, time to start learning! While it&#8217;s unlikely to be suitable for database workloads anywhere in the near future, I suspect we&#8217;ll see BTRFS as the root filesystem and XFS as the filesystem for the database server in the not too distant future.</li>
<li><a href="http://www.youtube.com/watch?v=SL7pbj7B1hk">Mistakes Were Made</a><br />
This session explores a number of rather indispensable things for those in operations &#8211; but also leaks over into development. Learning from our mistakes can only make us better at doing our jobs.</li>
<li><a href="http://www.youtube.com/watch?v=VY9SBPo1Oy8">Hack Everything: repurposing everyday devices</a><br />
This was great fun &#8211; reuse existing hardware to do awesome things!</li>
</ul>
<p>Talks that could be quite interesting for you, depending on your interests:</p>
<ul>
<li><a href="http://www.youtube.com/watch?v=FegjLbCnoBw">XFS: Recent and Future Adventures</a><br />
This talk covered a lot of the recent improvements in XFS. Especially interesting for those with metadata heavy workloads.</li>
<li><a href="http://www.youtube.com/watch?v=Nbv9L-WIu0s">Bloat: How and Why UNIX Grew Up (and Out) &#8211; Rusty Russell,Matt Evans</a><br />
This is a pretty neat examination of where bloat comes from taking V6 UNIX utilities as the baseline. It would be interesting to have a similar study on the database servers we all love and use.</li>
<li><a href="http://www.youtube.com/watch?v=QnCd0rG4Fvo">Migrating to PHP 5.4<br />
</a>Probably quite useful if you&#8217;re dealing with PHP (although I wasn&#8217;t in this session).</li>
<li><a href="http://www.youtube.com/watch?v=zrXFGjJyP8M">Finding vulnerabilities in PHP code (via static code analysis)<br />
</a>This one is for our web developers. It&#8217;s only a 20minute talk, so you should really all go and watch it. Various static analysis tools are part of the normal toolkit for C and C++ development these days, it&#8217;s great to see people working on them for other languages.</li>
</ul>
<p><strong>Talks I shall be watching the videos of as I was in another talk at the time:</strong></p>
<ul>
<li><a href="http://www.youtube.com/watch?v=3acclV9y-4c">Smashing a square peg into a round hole</a></li>
<li><a href="http://www.youtube.com/watch?v=KsywWf8dQgU">Codec2: Open Source Speech Codec</a></li>
<li><a href="http://www.youtube.com/watch?v=a8asl5SsGy4">Desktop Home Hacks</a></li>
<li><a href="http://www.youtube.com/watch?v=mpLHm5sSmSs">This Old Code, or Renovating Dusty Old Open Source For Fun and Profit</a><br />
This is especially interesting as I both know Greg and have talked to him about this work *and* because of my experience with the Drizzle project &#8211; we certainly have encountered more than our fair share of dusty old code during our time working on Drizzle.</li>
<li><a href="http://www.youtube.com/watch?v=ydS4vXNzN0I">Mentoring: we&#8217;re Doing It Wrong</a></li>
</ul>
<p><strong>My Talk:</strong></p>
<ul>
<li><a href="http://www.youtube.com/watch?v=3-t7KRAIwwA">Multi-tenancy, multi-master, sharding, scaling and analytics with Drizzle</a><br />
An update as to what we&#8217;ve been working on getting going in Drizzle.</li>
</ul>
<p><strong>All the videos are going up at:</strong></p>
<ul>
<li><a href="http://www.youtube.com/user/linuxconfau2012/videos">http://www.youtube.com/user/linuxconfau2012/videos</a></li>
</ul>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2012/01/24/linux-conf-au-2012-roundup/">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2012/01/mysql-performance-blog-linux-conf-au-2012-roundup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Performance Blog: MySQL Configuration Wizard Updated</title>
		<link>http://www.weez.com/2012/01/mysql-performance-blog-mysql-configuration-wizard-updated/</link>
		<comments>http://www.weez.com/2012/01/mysql-performance-blog-mysql-configuration-wizard-updated/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 20:11:06 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[updated]]></category>
		<category><![CDATA[Wizard]]></category>

		<guid isPermaLink="false">http://www.weez.com/2012/01/mysql-performance-blog-mysql-configuration-wizard-updated/</guid>
		<description><![CDATA[We&#8217;ve released an updated version of the MySQL Configuration Wizard we announced at the end of last year. If you don&#8217;t remember that announcement, here&#8217;s the short version: this is a tool to help you generate my.cnf files based on your server&#8217;s hardware and other characteristics. We&#8217;ve gotten really good feedback on this tool, including [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve released an updated version of the <a href="http://tools.percona.com/">MySQL Configuration Wizard</a> we announced at the end of last year. If you don&#8217;t remember that announcement, here&#8217;s the short version: this is a tool to help you generate my.cnf files based on your server&#8217;s hardware and other characteristics.</p>
<p>We&#8217;ve gotten really good feedback on this tool, including <a href="http://dba.stackexchange.com/questions/10553/tools-for-cnf-management-generation">this nice mention on Stack Exchange</a>:</p>
<blockquote><p>Percona just built a tool to do just that called the Configuration Wizard. I tested it out once just to see what it would return and the results were pretty darn close to what we were using on our servers, whose cnf&#8217;s were put together by highly trained mysql certified dba&#8217;s.</p>
</blockquote>
<p>So what&#8217;s changed in the new version of the Configuration Wizard? Quite a few things. We&#8217;ve rolled out the first iteration of the account and profile features.   Now you get a homepage with your configuration files, so you can manage them and return to them anytime you like.</p>
<p><a href="http://www.mysqlperformanceblog.com/wp-content/uploads/2012/01/homepage.png"><img src="http://www.mysqlperformanceblog.com/wp-content/uploads/2012/01/homepage-300x252.png" alt="" title="homepage" width="300" height="252" class="aligncenter size-medium wp-image-8420" /></a></p>
<p>From this page (click on the image for a fullsize view) you can do things like sharing configuration files and emailing them to yourself. The new release also adds features like downloading the configuration files so you don&#8217;t have to copy-paste them.</p>
<p>If you share a configuration file, then the URL can be loaded by anyone, even if they&#8217;re not logged in. It&#8217;s kind of like sending someone a link to a pastebin or something like that.  Screenshot:</p>
<p><a href="http://www.mysqlperformanceblog.com/wp-content/uploads/2012/01/shared.png"><img src="http://www.mysqlperformanceblog.com/wp-content/uploads/2012/01/shared-300x246.png" alt="" title="shared" width="300" height="246" class="aligncenter size-medium wp-image-8422" /></a></p>
<p>Another new feature is something I&#8217;ve wanted for a long time: the ability to generate a more strict, safer configuration file. There&#8217;s a new page in the Wizard that lets you set a lot of sanity/safety options to prevent common problems MySQL users run into because of too-permissive MySQL behaviors. These are the kinds of things that Drizzle fixes &#8212; and should be fixed by default in MySQL &#8212; but never will be because they might break applications that rely on the default behaviors. If you&#8217;re building an application from the ground up, now you can prevent bad things from getting a nose under the tent.  Here&#8217;s a screenshot:</p>
<p><a href="http://www.mysqlperformanceblog.com/wp-content/uploads/2012/01/safety.png"><img src="http://www.mysqlperformanceblog.com/wp-content/uploads/2012/01/safety-300x286.png" alt="" title="safety" width="300" height="286" class="aligncenter size-medium wp-image-8423" /></a></p>
<p>In addition to these things, we have added a number of other features you might not notice, which I won&#8217;t spend much time on &#8212; they&#8217;re things like an integrated feedback form at the left of the page and so on.</p>
<p>What&#8217;s next? Well, next I think we&#8217;re going to turn our attention to adding new tools, rather than improving this one.  I have a list of tools that people have requested or suggested: a SQL formatter, a visual EXPLAIN tool, a configuration advisor, a query analysis tool, a way to register a server&#8217;s essential characteristics and then get advice when there&#8217;s a new release that might be beneficial for you, and so on.  I have selected the next priorities, but I don&#8217;t want to spoil the surprise or promise something if it turns out to be harder than I think it will be.  What ideas do you have?  Let me know by leaving your feedback in the comments.</p>
<p>We hope this suite of free browser-based tools helps you become a more productive MySQL user and administrator!</p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2012/01/26/mysql-configuration-wizard-updated/">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2012/01/mysql-performance-blog-mysql-configuration-wizard-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Performance Blog: Schedule for MySQL Conference 2012 is Published</title>
		<link>http://www.weez.com/2012/01/mysql-performance-blog-schedule-for-mysql-conference-2012-is-published/</link>
		<comments>http://www.weez.com/2012/01/mysql-performance-blog-schedule-for-mysql-conference-2012-is-published/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 20:09:43 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Conference]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Published]]></category>
		<category><![CDATA[Schedule]]></category>

		<guid isPermaLink="false">http://www.weez.com/2012/01/mysql-performance-blog-schedule-for-mysql-conference-2012-is-published/</guid>
		<description><![CDATA[I am pleased to announce the schedule for Percona Live: MySQL Conference And Expo 2012 is now published. This is truly great selection of talks with something for MySQL Developers, DBAs, Managers, people just starting to use MySQL as well as looking for advanced topics. We have talks about running MySQL on extremely large scale [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to announce the schedule for <a href="http://www.percona.com/live/mysql-conference-2012/">Percona Live: MySQL Conference And Expo 2012</a> is <a href="http://www.percona.com/live/mysql-conference-2012/program/schedule/sessions-day-1">now published</a>.   This is truly great selection of talks with something for MySQL Developers, DBAs, Managers, people just starting to use MySQL as well as looking for advanced topics.   We have talks about running MySQL on extremely large scale in a Web as well as running MySQL In the Enterprise Environments.  Some speakers have spent over decade pushing MySQL to its limits, others have in depth experience working on MySQL Code. </p>
<p>We have many talks which are covering Oracle MySQL, and forks such as <a href="http://mariadb.org/">MariaDB</a>, <a href="http://www.drizzle.org/">Drizzle</a> and <a href="http://www.percona.com/software/percona-server/">Percona Server</a> are well covered too.  You will also have a chance to learn about commercial MySQL alternatives such as <a href="http://www.clustrix.com/">Clustrix</a> and <a href="http://www.schoonerinfotech.com/products/schoonersql">SchoonerSQL</a> from our sponsors. </p>
<p>At the same time this is the conference for MySQL Community. We&#8217;re talking about other database systems only as it comes to migration to MySQL and about NoSQL technologies such as Memcached,Redis,Sphinx which are commonly used to supplement MySQL. </p>
<p>The space was very tight this year and competition was very tough.  We had over 300 proposals for approximately 60 slots. As results committee had to make a lot of very tough choices and many great talks could not be accommodated. </p>
<p>We have a great <a href="http://www.percona.com/live/mysql-conference-2012/conference-committee">Conference Committee </a> this year who has done a great job getting the schedule together.  I can&#8217;t thank them enough !</p>
<p>See you in April in Santa Clara for<a href="http://www.percona.com/live/mysql-conference-2012/"> MySQL Conference</a>  and lets make this event an amazing success !   </p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2012/01/25/schedule-for-mysql-conference-2012-is-published/">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2012/01/mysql-performance-blog-schedule-for-mysql-conference-2012-is-published/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Performance Blog: MySQL opening .frm even when table is in table definition cache</title>
		<link>http://www.weez.com/2011/11/mysql-performance-blog-mysql-opening-frm-even-when-table-is-in-table-definition-cache/</link>
		<comments>http://www.weez.com/2011/11/mysql-performance-blog-mysql-opening-frm-even-when-table-is-in-table-definition-cache/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 20:08:45 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[*.frm]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[Definition]]></category>
		<category><![CDATA[even]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[opening]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/11/mysql-performance-blog-mysql-opening-frm-even-when-table-is-in-table-definition-cache/</guid>
		<description><![CDATA[or&#8230; &#8220;the case of Stewart recognizing parameters to the read() system call in strace output&#8221;. Last week, a colleague asked a question: I have an instance of MySQL with 100 tables and the table_definition_cache set to 1000. My understanding of this is that MySQL won&#8217;t revert to opening the FRM files to read the table [...]]]></description>
			<content:encoded><![CDATA[<p>or&#8230; &#8220;the case of Stewart recognizing parameters to the read() system call in strace output&#8221;.</p>
<p>Last week, a colleague asked a question:</p>
<blockquote><p>I have an instance of MySQL with 100 tables and the table_definition_cache set to 1000. My understanding of this is that MySQL won&#8217;t revert to opening the FRM files to read the table definition, but we can see from strace:</p>
<pre>[pid 19876] open("./db/t1.frm", O_RDONLY) = 32 &lt;0.000013&gt;
[pid 19876] read(32, ""..., 10)         = 10 &lt;0.000011&gt;
[pid 19876] close(32)                   = 0 &lt;0.000012&gt;
[pid 19876] open("./db/t2.frm", O_RDONLY) = 32 &lt;0.000014&gt;
[pid 19876] read(32, ""..., 10)         = 10 &lt;0.000012&gt;
[pid 19876] close(32)                   = 0 &lt;0.000012&gt;
[pid 19876] open("./db/t3.frm", O_RDONLY) = 32 &lt;0.000014&gt;
[pid 19876] read(32, ""..., 10)         = 10 &lt;0.000011&gt;
[pid 19876] close(32)                   = 0 &lt;0.000011&gt;
[pid 19876] open("./db/t4.frm", O_RDONLY) = 32 &lt;0.000013&gt;</pre>
</blockquote>
<p>So, why is this? It turns out that this triggered a memory for me from several years ago. I&#8217;ve since discovered the blog post in which I mention it: <a href="http://www.flamingspork.com/blog/2008/11/22/drop-table-fail-on-the-road-to-removing-the-frm/">drop table fail (on the road to removing the FRM)</a>. That blog post is from 2008, almost three years ago to the day.</p>
<p>Since we completely reworked how metadata works in Drizzle, it has enabled us to do some truly wonderful things, including more in depth testing of the server. Amazingly enough, spin-offs from this work included being able to find out and then test that the <a href="http://www.flamingspork.com/blog/2010/06/29/enum-now-works-properly-in-drizzle/">ENUM limit of 65,535 has never been true</a> (but now is in Drizzle), produce a <a href="http://www.flamingspork.com/blog/2010/06/03/new-create-table-performance-record/">CREATE TABLE statement that took over four minutes to execute</a> and get <a href="http://www.flamingspork.com/blog/2010/11/29/a-more-complete-look-at-storage-engine-api/">a more complete view of how the Storage Engine API is called</a>.</p>
<p>But back to what the above strace shows. In MySQL 5.5 you can find in sql/datadict.cc a function named dd_frm_type(). In MySQL 5.1, for some reason yet unknown to humans, it lives in sql/sql_view.cc as mysql_frm_type(). What this code snippet does is:</p>
<ul>
<li>open the FRM</li>
<li>read 10 bytes (&#8220;header&#8221;)</li>
<li>check if it&#8217;s a view by doing a string compare for &#8220;TYPE=VIEW\n&#8221; being the first bytes of the FRM file. This is due to VIEWs being stored as the plain text of the SQL query inside the FRM file instead of the normal binary format FRM.</li>
<li>some legacy check for a generic table type (I think, I haven&#8217;t gone back into the deep history of the FRM file format to confirm)</li>
<li>return the fourth byte for the DB_TYPE. i.e. what storage engine it is.</li>
</ul>
<p>We can ignore the upper limit on number of storage engines for MySQL and understanding the relationship between the range of numbers for dynamic assignment and what this means for on-disk compatibility of data directories is left as an exercise for the reader.</p>
<p>This code is called from several code paths in the server:</p>
<ul>
<li>DROP TABLE</li>
<li>RENAME TABLE</li>
<li>DROP VIEW</li>
<li>open table</li>
<li>filling INFORMATION_SCHEMA tables (I think it is actually the TABLES table, but didn&#8217;t look closely)</li>
</ul>
<div>An example of how this is used is that in the DROP TABLE code path, MySQL uses this magic byte to work out which Storage Engine to ask to drop the table. The main consequence of this bit of code is that MySQL may cause unnecessary disk IO for information it already has cached (often at least twice &#8211; in InnoDB itself and in the table_definition_cache).</div>
<p>Further reading:</p>
<ul>
<li><a href="http://forge.mysql.com/wiki/MySQL_Internals_File_Formats">MySQL Forge Internals document on the FRM file format</a></li>
<li><a href="http://www.flamingspork.com/blog/2009/02/15/the-frm-file-format/">Stewart&#8217;s blog post on the FRM file format</a> (from early 2009, towards the very end of removing the FRM file from Drizzle if I remember correctly)</li>
</ul>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2011/11/21/mysql-opening-frm-even-when-table-is-in-table-definition-cache/">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/11/mysql-performance-blog-mysql-opening-frm-even-when-table-is-in-table-definition-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Performance Blog: Stewart speaking at OSDC 2011</title>
		<link>http://www.weez.com/2011/11/mysql-performance-blog-stewart-speaking-at-osdc-2011/</link>
		<comments>http://www.weez.com/2011/11/mysql-performance-blog-stewart-speaking-at-osdc-2011/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 22:07:00 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[2011]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[OSDC]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Speaking]]></category>
		<category><![CDATA[Stewart]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/11/mysql-performance-blog-stewart-speaking-at-osdc-2011/</guid>
		<description><![CDATA[I&#8217;ve just arrived at ANU in Canberra for the Open Source Developers Conference 2011 (OSDC). I&#8217;ve spoken at several of the past OSDCs that have been held around Australia: 2005, 2007, 2008, 2010 and now 2011. It&#8217;s one of those conferences with great energy and great people that&#8217;s organised by dedicated members in the community [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just arrived at ANU in Canberra for the <a href="http://www.osdc.com.au">Open Source Developers Conference</a> 2011 (OSDC). I&#8217;ve spoken at several of the past OSDCs that have been held around Australia: 2005, 2007, 2008, 2010 and now 2011. It&#8217;s one of those conferences with great energy and great people that&#8217;s organised by dedicated members in the community who build the conference they want to go to.</p>
<p>I&#8217;ll be giving two talks this year:</p>
<ul>
<li><a href="http://osdc.com.au/schedule/#droppingacideatin">Dropping ACID: Eating Data in a Web 2.0 Cloud World</a></li>
<li><a href="http://osdc.com.au/schedule/#drizzle7gaandsupp">Drizzle 7: GA and Supported: Current and Future Features</a></li>
</ul>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2011/11/17/stewart-speaking-at-osdc-2011/">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/11/mysql-performance-blog-stewart-speaking-at-osdc-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Performance Blog: dbqp and Xtrabackup testing</title>
		<link>http://www.weez.com/2011/11/mysql-performance-blog-dbqp-and-xtrabackup-testing/</link>
		<comments>http://www.weez.com/2011/11/mysql-performance-blog-dbqp-and-xtrabackup-testing/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 22:01:57 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[dbqp]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Xtrabackup]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/11/mysql-performance-blog-dbqp-and-xtrabackup-testing/</guid>
		<description><![CDATA[So I’m back from the Percona dev team’s recent meeting.  While there, we spent a fair bit of time discussing Xtrabackup development.  One of our challenges is that as we add richer features to the tool, we need equivalent testing capabilities.  However, it seems a constant in the MySQL world that available QA tools often [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>So I’m back from the <a href="http://www.percona.com/">Percona</a> dev team’s recent meeting.  While there, we spent a fair bit of time discussing <a href="http://www.percona.com/software/percona-xtrabackup/">Xtrabackup</a> development.  One of our challenges is that as we add richer features to the tool, we need equivalent testing capabilities.  However, it seems a constant in the MySQL world that available QA tools often leave something to be desired.  The <a href="https://launchpad.net/randgen">randgen</a> is a literal wonder-tool for database testing, but it is also occasionally frustrating / doesn’t scratch every testing itch.  It is based on technology SQL Server was using in 1998 (MySQL began using it in ~2007, IIRC).  So this is no knock, it is merely meant to be an example of a poor QA engineer’s frustrations ; )  While the current <a href="http://www.percona.com/software/percona-xtrabackup/">Xtrabackup</a> test suite is commendable, it also has its limitations. Enter the flexible, adaptable, and expressive answer: <a href="http://www.wc220.com/?category_name=dbqp">dbqp</a>.</p>
<p>One of my demos at the dev meeting was showing how we can set up tests for Xtrabackup using the unittest paradigm.  While this sounds fancy, basically, we take advantage of <a href="http://docs.python.org/library/unittest.html">Python’s unittest</a> and write classes that use their code.  The biggest bit <a href="http://docs.drizzle.org/testing/dbqp.html">dbqp</a> does is search the specified server code (to make sure we have everything we should), allocate and manage servers as requested by the test cases, and do some reporting and management of the test cases.  As the tool matures, I will be striving to let more of the work be done by unittest code rather than things I have written : )</p>
<p>To return to my main point, we now have two basic tests of xtrabackup:</p>
<h4>Basic test of backup + restore:</h4>
<ol>
<li>Populate server</li>
<li>Take a validation snapshot (mysqldump)</li>
<li>Take the backup (via innobackupex)</li>
<li>Clean datadir</li>
<li>Restore from backup</li>
<li>Take restored state snapshot and compare to original state</li>
</ol>
<h4>Slave setup</h4>
<ol>
<li>Similar to our basic test except we create a slave from the backup, replicating from the backed up server.</li>
<li>After the initial setup, we ensure replication is set up ok, then we do additional work on the master and compare master and slave states</li>
</ol>
<p>One of the great things about this is that we have the <a href="http://docs.python.org/library/unittest.html#assert-methods">magic of assertions</a>.  We can insert them at any point of the test we feel like validating and the test will fail with useful output at that stage.  The backup didn’t take correctly?  No point going through any other steps — FAIL! : )  The assertion methods just make it easy to express what behavior we are looking for.  We want the innobackupex prepare call to run without error?<br />
<a href="http://www.youtube.com/watch?v=W45DRy7M1no">Boom goes the dynamite!</a>:</p>
<pre>
# prepare our backup
cmd = ("%s --apply-log --no-timestamp --use-memory=500M "
"--ibbackup=%s %s" %( innobackupex
, xtrabackup
, backup_path))
retcode, output = execute_cmd(cmd, output_path, exec_path, True)
self.assertEqual(retcode, 0, msg = output)
</pre>
<p>From these basic tests, it will be easy to craft more complex test cases.  Creating the slave test was simply matter of adapting the initial basic test case slightly.  Our plans include: *heavy* crash testing of both xtrabackup and the server, enhancing / expanding replication tests by creating heavy randgen loads against the master during backup and slave setup, and other assorted crimes against database software.  We will also be porting the existing test suite to use dbqp entirely…who knows, we may even start working on Windows one day ; )</p>
<p>These tests are by no means the be-all-end-all, but I think they do represent an interesting step forward.  We can now write actual, <a href="http://xkcd.com/353/">honest-to-goodness Python code</a> to test the server.  On top of that, we can make use of the included unittest module to give us all sorts of assertive goodness to express what we are looking for.  We will need to and plan to refine things as time moves forward, but at the moment, we are able to do some cool testing tricks that weren’t easily do-able before.</p>
<p>If you’d like to try these tests out, you will need the following:<br />
* <a href="https://launchpad.net/dbqp">dbqp</a> (bzr branch lp:dbqp)<br />
* <a href="http://search.cpan.org/%7Ecapttofu/DBD-mysql-4.018/lib/DBD/mysql.pm">DBD:mysql</a> installed (test tests use the randgen and this is required…hey, it is a WONDER-tool!) : )<br />
* <a href="http://www.percona.com/doc/percona-xtrabackup/innobackupex/innobackupex_script.html">Innobackupex</a>, a MySQL / Percona server and the appropriate xtrabackup binary.</p>
<p>The tests live in dbqp/percona_tests/xtrabackup_basic and are named basic_test.py and slave_test.py, respectively.</p>
<p>To run them:<br />
$./dbqp.py –suite=xtrabackup_basic –basedir=/path/to/mysql –xtrabackup-path=/mah/path –innobackupex-path=/mah/other/path –default-server-type=mysql –no-shm</p>
<p>Some next steps for dbqp include:<br />
1)  Improved docs<br />
2)  Merging into the Percona Server trees<br />
3)  Setting up test jobs in Jenkins (crashme / sqlbench / randgen)<br />
4)  Other assorted awesomeness</p>
<p>Naturally, this testing goodness will also find its way into <a href="http://www.drizzle.org/">Drizzle</a> (which currently has a <a href="http://blog.drizzle.org/2011/10/25/fremont-beta-2011-10-28-has-been-released/">7.1 beta out</a>).  We definitely need to see some Xtrabackup test cases for <a href="http://www.flamingspork.com/blog/2011/04/01/online-non-blocking-backup-for-drizzle-with-xtrabackup/">Drizzle’s version of the tool</a> (mwa ha ha!) &gt;: )</p>
</div>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2011/11/16/dbqp-and-xtrabackup-testing/">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/11/mysql-performance-blog-dbqp-and-xtrabackup-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Performance Blog: Fishing with dynamite, brought to you by the randgen and dbqp</title>
		<link>http://www.weez.com/2011/11/mysql-performance-blog-fishing-with-dynamite-brought-to-you-by-the-randgen-and-dbqp/</link>
		<comments>http://www.weez.com/2011/11/mysql-performance-blog-fishing-with-dynamite-brought-to-you-by-the-randgen-and-dbqp/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 20:06:52 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[brought]]></category>
		<category><![CDATA[dbqp]]></category>
		<category><![CDATA[dynamite]]></category>
		<category><![CDATA[Fishing]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[randgen.]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/11/mysql-performance-blog-fishing-with-dynamite-brought-to-you-by-the-randgen-and-dbqp/</guid>
		<description><![CDATA[I tend to speak highly of the random query generator as a testing tool and thought I would share a story that shows how it can really shine. At our recent dev team meeting, we spent approximately 30 minutes of hack time to produce test cases for 3 rather hard to duplicate bugs. Of course, [...]]]></description>
			<content:encoded><![CDATA[<p>I tend to speak highly of the <a href="https://launchpad.net/randgen">random query generator</a> as a testing tool and thought I would share a story that shows how it can really shine. At our recent dev team meeting, we spent approximately 30 minutes of hack time to produce test cases for 3 rather hard to duplicate bugs. Of course, I would also like to think that the way we have packaged our randgen tests into unittest format for <a href="https://launchpad.net/dbqp">dbqp</a> played some small part, but I might be mildly biased.</p>
<p>The best description of the randgen&#8217;s power comes courtesy of <a href="http://www.linuxjedi.co.uk/">Andrew Hutchings</a> &#8211; &#8220;<a href="http://en.wikipedia.org/wiki/Blast_fishing">fishing with dynamite</a>&#8220;. This is a very apt metaphor for how the tool works &#8211; it can be quite effective for stressing a server and finding bugs, but it can also be quite messy, possibly even fatal if one is careless. ; ) However, I am not writing this to share any horror stories, but glorious tales of bug hunting!</p>
<p>The randgen uses yacc-style <a href="http://forge.mysql.com/wiki/RandomQueryGeneratorGrammar">grammar files</a> that define a realm of possible queries (provided you did it right&#8230;the zen of grammar writing is a topic for another day). Doing this allows us to produce high volumes of queries that are hopefully interesting (see previous comment about grammar-writing-zen).</p>
<p>It takes a certain amount of care to produce a grammar that is useful and interesting, but the gamble is that this effort will produce more interesting effects on the database than the hand-written queries that could be produced in similar time. This is especially useful when you aren&#8217;t quite sure where a problem is and are just trying to see what shakes out under a certain type of stress.  Another win is that a well-crafted grammar can be used for a variety of scenarios.  The transactional grammars that were originally written for testing Drizzle&#8217;s replication system have been reused many times (including for two of these bugs!)</p>
<p>This brings us to our first bug:<br />
<a href="https://bugs.launchpad.net/percona-server/+bug/758788"> mysql process crashes after setting innodb_dict_size</a></p>
<p>The basics of this were that the server was crashing under load when <a href="http://www.percona.com/doc/percona-server/5.5/management/innodb_dict_size_limit.html?id=percona-server:features:innodb_dict_size_limit&amp;redirect=1">innodb_dict_size_limit</a> was set to a smaller value. In order to simulate the situation, <a href="http://www.flamingspork.com/blog/">Stewart</a> suggested we use a transactional load against a large number of tables. We were able to make this happen in 4 easy steps:<br />
1) Create a test case module that we can execute. All of the randgen test cases are structured similarly, so all we had to do was copy an existing test case and tweak our server options and randgen command line as needed.</p>
<p>2) Make an altered copy of the general, percona.zz gendata file. This file is used by the randgen to determine the number, composition, and population of any test tables we want to use and generate them for us. As the original reporter indicated they had a fair number of tables:</p>
<pre>
$tables = {
rows =&gt; [1..50],
partitions =&gt; [ undef ]
};
</pre>
<p>The value in the &#8216;rows&#8217; section tells the data generator to produce 50 tables, with sizes from 1 row to 50 rows.</p>
<p>3) Specify the server options. We wanted the server to hit similar limits as the original bug reporter, but we were working on a smaller scale.<br />
To make this happen, we set the following options in the test case:</p>
<pre>
server_requirements = [["--innodb-dict-size-limit=200k --table-open-cache=10"]]
</pre>
<p>Granted, these are insanely small values, but this is a test and we&#8217;re trying to do horrible things to the server ; )</p>
<p>4) Set up our test_* method in our testcase class. This is all we need to specify in our test case:</p>
<pre>
def test_bug758788(self):
test_cmd = ("./gentest.pl "
            "--gendata=conf/percona/innodb_dict_size_limit.zz "
            "--grammar=conf/percona/translog_concurrent1.yy "
            "--queries=1000 "
            "--threads=1")
retcode, output = execute_randgen(test_cmd, test_executor, servers)
self.assertTrue(retcode==0, output)
</pre>
<p>The test is simply to ensure that the server remains up and running under a basic transactional load</p>
<p>From there, we only need to use the following command to execute the test:<br />
./dbqp.py &#8211;default-server-type=mysql &#8211;basedir=/path/to/Percona-Server &#8211;suite=randgen_basic innodbDictSizeLimit_test<br />
This enabled us to reproduce the crash within 5 seconds.</p>
<p>The reason I think this is interesting is that we were unable to duplicate this bug otherwise. The combination of the randgen&#8217;s power and dbqp&#8217;s organization helped us knock this out with about 15 minutes of tinkering.</p>
<p>Once we had a bead on this bug, we went on to try a couple of other bugs:</p>
<p><a href="https://bugs.launchpad.net/percona-server/+bug/856404"> Crash when query_cache_strip_comments enabled</a></p>
<p>For this one, we only modified the grammar file to include this as a possible WHERE clause for SELECT queries:</p>
<pre>
WHERE X . char_field_name != 'If you need to translate Views labels into other languages, consider installing the &lt;a href=\" !path\"&gt;Internationalization&lt;/a&gt; package\'s Views translation module.'
</pre>
<p>The test value was taken from the original bug report.<br />
Similar creation of a test case file + modifications resulted in another easily reproduced crash.<br />
I will admit that there may be other ways to go about hitting that particular bug, but we *were* practicing with new tools and playing with dynamite can be quite exhilarating ; )<br />
<a href="https://bugs.launchpad.net/percona-xtrabackup/+bug/826632"> parallel option breaks backups and restores</a></p>
<p>For this bug, we needed to ensure that the server used &#8211;innodb_file_per_table and that we used <a href="http://www.percona.com/software/percona-xtrabackup/">Xtrabackup</a>&#8216;s <a href="http://www.percona.com/doc/percona-xtrabackup/innobackupex/parallel_copy_ibk.html">&#8211;parallel</a> option. I also wanted to create multiple schemas and we did via a little randgen / python magic:</p>
<pre>
# populate our server with a test bed
test_cmd = "./gentest.pl --gendata=conf/percona/bug826632.zz "
retcode, output = execute_randgen(test_cmd, test_executor, servers)
# create additional schemas for backup
schema_basename='test'
for i in range(6):
    schema = schema_basename+str(i)
    query = "CREATE SCHEMA %s" %(schema)
    retcode, result_set = execute_query(query, master_server)
    self.assertEquals(retcode,0, msg=result_set)
    retcode, output = execute_randgen(test_cmd, test_executor, servers, schema)
</pre>
<p>This gave us 7 schemas, all with 100 tables per schema (with rows 1-100). From here we take a backup with &#8211;parallel=50 and then try to restore it. These are basically the same steps we use in our basic_test from the xtrabackup suite. We just copied and modified the test case to suit our needs for this bug. With this setup, we need a crash / failure during the prepare phase of the backup. Interestingly this only happens with this number of tables, schemas, and &#8211;parallel threads.</p>
<p>Not too shabby for about 30 minutes of hacking + explaining things, if I do say so myself. One of the biggest difficulties in fixing bugs comes from being able to recreate them reliably and easily. Between the randgen&#8217;s brutal ability to produce test data and queries and dbqp&#8217;s efficient test organization, we are now able to quickly produce complicated test scenarios and reproduce more bugs so our amazing dev team can fix them into oblivion : )</p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2011/11/16/fishing-with-dynamite-brought-to-you-by-the-randgen-and-dbqp/">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/11/mysql-performance-blog-fishing-with-dynamite-brought-to-you-by-the-randgen-and-dbqp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Side load may massively impact your MySQL Performance</title>
		<link>http://www.weez.com/2011/11/side-load-may-massively-impact-your-mysql-performance/</link>
		<comments>http://www.weez.com/2011/11/side-load-may-massively-impact-your-mysql-performance/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 00:03:38 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[impact]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[massively]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Side]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/11/side-load-may-massively-impact-your-mysql-performance/</guid>
		<description><![CDATA[When we&#8217;re looking at benchmarks we typically run some stable workload and we run it in isolation &#8211; nothing else is happening on the system. This is not however how things happen in real world when we have significant variance in the load and many things can be happening concurrently. It is very typical to [...]]]></description>
			<content:encoded><![CDATA[<p>When we&#8217;re looking at benchmarks we typically run some stable workload and we run it in isolation &#8211; nothing else is happening on the system.  This is not however how things happen in real world when we have significant variance in the load and many things can be happening concurrently. </p>
<p>It is very typical to hear complains about MySQL interactive performance &#8211; serving simple standard web traffic is drastically impacted when some heavy queries are ran in background or backup is done with <strong>mysqldump</strong>  &#8211; a lot more than you would expect from simple resource competition.   I finally found some time to look further in this problem and see what can be done to remedy it.<br />
<span id="more-7354"></span></p>
<p>We designed the benchmark the following way &#8211; there is a small table (200MB) which completely fits in the Innodb Buffer Pool (512MB).  We also have larger table 4GB which does not fit in the buffer pool.  We&#8217;re running uniform sysbench OLTP on the small table and mysqldump on the second table.  First we run tests individually and when concurrently.   </p>
<p>In the perfect world what we would like to see is performance is staying about the same when we run tests concurrently because Sysbench should run completely in memory and use a lot of CPU resources but none of disk IO and mysqldump  should have relatively little CPU needs and be bound by disk.  Also these are just 2 &#8220;threads&#8221; running on 4 core system so there should be plenty CPU to spare.</p>
<p>We&#8217;re using Percona Server 5.5.15 for this test with buffer pool size of 512MB and innodb_flush_method=O_DIRECT </p>
<p>Test Setup:</p>
<blockquote><p>
[root@localhost msb_ps_5_5_15]# sysbench &#8211;test=oltp &#8211;db-driver=mysql &#8211;mysql-host=localhost &#8211;mysql-table-engine=innodb &#8211;mysql-db=test &#8211;oltp-table-name=md_cache_test_small &#8211;oltp-table-size=1100000 &#8211;mysql-user=msandbox &#8211;mysql-password=msandbox &#8211;mysql-socket=/tmp/mysql_sandbox5516.sock prepare</p>
<p>[root@localhost msb_ps_5_5_15]# sysbench &#8211;test=oltp &#8211;db-driver=mysql &#8211;mysql-host=localhost &#8211;mysql-table-engine=innodb &#8211;mysql-db=test &#8211;oltp-table-name=md_cache_test_big &#8211;oltp-table-size=17600000 &#8211;mysql-user=msandbox &#8211;mysql-password=msandbox &#8211;mysql-socket=/tmp/mysql_sandbox5516.sock prepare
</p>
</blockquote>
<p>Running Sysbench and MySQLDump. Note we run them in the loop to see how result stabilizes.</p>
<blockquote><p>
[root@localhost msb_ps_5_5_15]# sysbench &#8211;test=oltp &#8211;db-driver=mysql &#8211;num-threads=1 &#8211;max-requests=0 &#8211;oltp-dist-type=uniform &#8211;max-time=180 &#8211;oltp-read-only &#8211;mysql-host=localhost &#8211;mysql-table-engine=innodb &#8211;mysql-db=test &#8211;oltp-table-name=md_cache_test_small &#8211;oltp-table-size=1100000 &#8211;mysql-user=msandbox &#8211;mysql-password=msandbox &#8211;mysql-socket=/tmp/mysql_sandbox5516.sock run</p>
<p>[root@localhost msb_ps_5_5_15]# time mysqldump &#8211;defaults-file=my.sandbox.cnf test md_cache_test_big > /dev/null
</p>
</blockquote>
<p>Baseline Run:<br />
When we run the tests individually   Sysbench gives about  <strong>330 req/sec</strong>   and mysqldump for large table completes in about <strong>95 seconds</strong>.<br />
If we run them concurrently after system reaches steady state we get about <strong>2 req/sec</strong> and mysqldump takes about <strong>180 seconds</strong>.</p>
<p>Yes you get it right.  Performance of sysbench OLTP on small table drops  <strong>more than 150 times</strong> when heavy mysqldump is running concurrently.  mysqldump itself also slows down<br />
about 2x.</p>
<p>What is going on here ?  To understand it we should take a look at the buffer pool contents. </p>
<blockquote><p>
mysql [localhost] {msandbox} (information_schema) > select t.schema, t.name, t.table_id, i.index_id, i.name, sum(data_size)/1024/1024 as data_size_mb from innodb_sys_tables as t inner join innodb_sys_indexes as i using(table_id) inner join innodb_buffer_pool_pages_index as p using(index_id) where t.schema=&#8217;test&#8217; group by i.index_id \G<br />
INDEX_NAME				DATA_SIZE_MB<br />
test.md_cache_test_small.PRIMARY	216.31397057<br />
test.md_cache_test_small.k	2.66948509<br />
test.md_cache_test_big.PRIMARY	250.76164627</p>
<p>&#8230;..</p>
<p>INDEX_NAME				DATA_SIZE_MB<br />
test.md_cache_test_small.PRIMARY	12.10487175<br />
test.md_cache_test_big.PRIMARY	457.70432472
</p>
</blockquote>
<p>When we&#8217;re running sysbench OLTP on its own we have the primary key of the table fit completely in the buffer pool.  However when mysqldump is ran concurrently it reads so many pages from the disk it pushes out most of the smaller table from the buffer pool with only 12MB remaining. This makes workload extremely IO bound hence such drop in performance. </p>
<p>The performance of mysqldump is impacted too because we now have 2 threads competing for what is single hard drive on this test system. </p>
<p>It is worth to note MySQL actually uses midpoint insertion for its <a href="http://dev.mysql.com/doc/refman/5.5/en/innodb-buffer-pool.html">buffer pool replacement policy </a>. Unfortunately by default it is configured in a way it is quite useless.  The blocks are indeed first placed in the head of &#8220;old&#8221; sublist which mean they should not push any hot data which is in &#8220;young&#8221; sublist. However when you&#8217;re doing mysqldump (or running some complex batch job query)  you are likely going to have multiple accesses to the data on the same page before being done with it for good. Because there are several accesses page really gets immediately moved to the young sublist and as such placing high pressure on buffer pool. </p>
<p>There is ingenious feature though to deal with this problem, it is just you have to enable it separately.  There is a variable <strong>innodb_old_blocks_time</strong> which specifies amount of milliseconds which needs to pass before table can be moved to the young sublist.  In typical cases like mysqldump all accesses to the majority of pages will be concentrated within very small period of time so setting innodb_old_blocks_time variable to some value will prevent important data to be pushed out of buffer pool.</p>
<p>Lets repeat the benchmark with <strong>innodb_old_blocks_time=1000</strong> which will correspond to 1 sec.</p>
<p>Separate Sysbench gives about<strong> 330 req/sec</strong> and mysqldump <strong>about 95 seconds</strong> which is the same.  Note we ran test on virtualized system in this case so we would not be able to measure small variances in performance reliably.</p>
<p>Running Sysbench and MySQLDump convurrently gives about  <strong>325 req/sec</strong> for sysbench and some <strong>100 seconds for mysqldump</strong>  which is a dramatic improvement of over<br />
150x for sysbench and results now going inline with what you would expect.</p>
<p>Lets see what is going on with buffer pool contents:</p>
<blockquote><p>
INDEX_NAME				DATA_SIZE_MB<br />
test.md_cache_test_small.PRIMARY	216.35031509<br />
test.md_cache_test_small.k	0.13414192<br />
test.md_cache_test_big.PRIMARY	253.21095276<br />
test.md_cache_test_big.k	0.01491451</p>
<p>&#8230;..<br />
INDEX_NAME				DATA_SIZE_MB<br />
test.md_cache_test_small.PRIMARY	216.35031509<br />
test.md_cache_test_big.PRIMARY	253.19661140<br />
test.md_cache_test_big.k	0.01491451
</p>
</blockquote>
<p>As you can see now the small table PRIMARY KEY (which is what used by benchmark) is not pushed from buffer pool at all. </p>
<p>For advanced tuning you might also look into changing how buffer pool is split into young and old sublists via <strong>innodb_old_blocks_pct</strong> variable though we did not need to do it in this case.</p>
<p>I&#8217;m not sure if there are any bad side effects from setting innodb_old_blocks_time to non zero value, if not I would strongly suggest changing default from zero in MySQL 5.6 as it would offer much better &#8220;out of box&#8221; user experience.</p>
<p><strong>Summary</strong><br />
As we can see in default configuration MySQL has buffer pool which can be easily washed away by large table scans or heavy batch jobs.  If this happen the workload which is normally in memory becomes disk IO bound which can slow it down more than 100 times. The solution is rather easy though. Setting innodb_old_blocks_time to 1000 or other meaningful number is an easy remedy for this problem. </p>
<p>I want to thank <a href="http://www.percona.com/about-us/our-team/ovais-tariq/">Ovais Tariq</a> for doing a lot of heavy lifting running benchmarks for this post. </p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2011/11/13/side-load-may-massively-impact-your-mysql-performance/">MySQL Performance Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/11/side-load-may-massively-impact-your-mysql-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Performance Blog: Percona Server 5.1.57 with Galera 0.8.1</title>
		<link>http://www.weez.com/2011/11/mysql-performance-blog-percona-server-5-1-57-with-galera-0-8-1/</link>
		<comments>http://www.weez.com/2011/11/mysql-performance-blog-percona-server-5-1-57-with-galera-0-8-1/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 20:10:37 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[0.8.1]]></category>
		<category><![CDATA[5.1.57]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[galera]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Percona]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/11/mysql-performance-blog-percona-server-5-1-57-with-galera-0-8-1/</guid>
		<description><![CDATA[Codership team announced availability of MySQL/Galera 0.8.1, which is minor release, but actually it has bunch of improvements that makes Galera replication more user friendly (there are many bugs fixed, reported by me personally, what annoyed me a lot). As part of my evaluation activity I ported MySQL/Galera 0.8.1 to Percona Server/Galera 0.8.1 and you [...]]]></description>
			<content:encoded><![CDATA[<p>Codership team announced availability of <a href="http://www.codership.com/content/mysqlgalera-081-released">MySQL/Galera 0.8.1</a>, which is minor release, but actually it has bunch of improvements that makes Galera replication more user friendly (there are many bugs fixed, reported by me personally, what annoyed me a lot).</p>
<p>As part of my evaluation activity I ported MySQL/Galera 0.8.1 to Percona Server/Galera 0.8.1 and you can get <a href="https://code.launchpad.net/~vadim-tk/percona-server/percona-galera-5.1.57-0.8.1">source code on Launchpad</a>.</p>
<p>I appreciate the fact that not everybody has fun from compiling source code (hint, hint for Drizzle developers), that is why I also made binaries for RHEL 6.1 / Oracle Linux 6.1<br />
<a href="http://www.percona.com/downloads/TESTING/Galera/percona-5.1.57-galera-0.8.1.tar.gz">http://www.percona.com/downloads/TESTING/Galera/percona-5.1.57-galera-0.8.1.tar.gz</a></p>
<p>This is ABSOLUTELY NO production quality release, but you are welcome to play with it.</p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2011/07/28/percona-server-5-1-57-with-galera-0-8-1/">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/11/mysql-performance-blog-percona-server-5-1-57-with-galera-0-8-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Performance Blog: Percona turns 5 years old</title>
		<link>http://www.weez.com/2011/10/mysql-performance-blog-percona-turns-5-years-old/</link>
		<comments>http://www.weez.com/2011/10/mysql-performance-blog-percona-turns-5-years-old/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 20:15:07 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Percona]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[turns]]></category>
		<category><![CDATA[years]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/10/mysql-performance-blog-percona-turns-5-years-old/</guid>
		<description><![CDATA[It&#8217;s August 1st, 2011, and five years ago on or about this date (who can remember clearly?) Peter Zaitsev and Vadim Tkachenko founded Percona. What&#8217;s happened in the last five years? We&#8217;re a privately held, privately funded company of over 50 employees distributed globally, serving 1200 customers worldwide with support, consulting, training, and engineering services [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s August 1st, 2011, and five years ago on or about this date (who can remember clearly?) Peter Zaitsev and Vadim Tkachenko founded Percona.  What&#8217;s happened in the last five years?<span id="more-6435"></span></p>
<p>We&#8217;re a privately held, privately funded company of <a href="http://www.percona.com/about-us/our-team/">over 50 employees</a> distributed globally, serving 1200 customers worldwide with support, consulting, training, and engineering services for MySQL.  Our revenue isn&#8217;t public, but we&#8217;re proud that we&#8217;re able to keep all those people busy and help provide for their families.  We&#8217;ve contributed significantly to improved performance and advanced functionality in the MySQL server and InnoDB storage engine, and created the first and only opensource hot-backup tool for InnoDB, as well as many other <a href="http://www.percona.com/software/">open-source software engineering projects</a>.</p>
<p>We&#8217;re happy that we&#8217;ve achieved this much, but our future plans are ambitious too.  We&#8217;d rather first lay eggs and then cackle, than the other way around.  So watch this blog for news about what&#8217;s next from Percona.</p>
<p>A heartfelt thanks to all of Percona&#8217;s customers, without whom there&#8217;d be no company.  And likewise, to our team members.  To the MySQL community, including MariaDB and Drizzle; and the business ecosystem and third-party providers, both closed and open source.  Finally, much gratitude is due to Oracle, and also to MySQL&#8217;s previous stewards: Sun Microsystems, MySQL AB, and of course Monty Widenius and David Axmark, and Heikki Tuuri, who started it all so many years ago.</p>
<p>Here&#8217;s to the next five years.</p>
<p>Sincerely,</p>
<p>Peter Zaitsev, CEO<br />
Vadim Tkachenko, CTO<br />
Baron Schwartz, Chief Performance Architect<br />
Tom Basil, COO<br />
Bill Schuler, VP of Sales<br />
Espen Braekken, VP of Global Services</p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2011/08/01/percona-turns-5-years-old/">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/10/mysql-performance-blog-percona-turns-5-years-old/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

