<?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>Transactions on InnoDB &#187; Concurrency</title>
	<atom:link href="http://blogs.innodb.com/wp/tag/concurrency/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.innodb.com/wp</link>
	<description>&#34;The word&#34; about InnoDB Products and Technology</description>
	<lastBuildDate>Fri, 23 Dec 2011 11:17:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>InnoDB Conference Presentations Now Online</title>
		<link>http://blogs.innodb.com/wp/2009/05/innodb-conference-presentations-now-aonline/</link>
		<comments>http://blogs.innodb.com/wp/2009/05/innodb-conference-presentations-now-aonline/#comments</comments>
		<pubDate>Wed, 13 May 2009 00:30:48 +0000</pubDate>
		<dc:creator>Ken Jacobs</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Concurrency]]></category>
		<category><![CDATA[InnoDB]]></category>
		<category><![CDATA[internals]]></category>
		<category><![CDATA[Locking]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[Row Formats]]></category>

		<guid isPermaLink="false">http://blogs.innodb.com/wp/?p=434</guid>
		<description><![CDATA[Well, it took us a little while (we&#8217;ve been busy !), but we&#8217;ve now posted our presentations on InnoDB from the MySQL Conference and Expo 2009. You can download these presentations by Heikki Tuuri, Ken Jacobs and Calvin Sun from the InnoDB website, as follows: Ken and Heikki: InnoDB: Innovative Technologies for Performance and Data [...]]]></description>
			<content:encoded><![CDATA[<p>
<p>
Well, it took us a little while (we&#8217;ve been busy <img src='http://blogs.innodb.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  !), but we&#8217;ve now posted our presentations on InnoDB from the MySQL Conference and Expo 2009.  You can download these presentations by <a href="http://www.mysqlconf.com/mysql2009/public/schedule/speaker/1311">Heikki Tuuri</a>, <a href="http://www.mysqlconf.com/mysql2009/public/schedule/speaker/1312">Ken Jacobs</a> and <a href="http://www.mysqlconf.com/mysql2009/public/schedule/speaker/12396">Calvin Sun</a> from the InnoDB website, as follows:</p>
<ul>
<li>Ken and Heikki: <a href="http://www.innodb.com/wp/wp-content/uploads/2009/05/innovative-technologies-final.pdf">InnoDB: Innovative Technologies for Performance and Data Protection</a></li>
<li>Heikki: <a href="http://www.innodb.com/wp/wp-content/uploads/2009/05/innodbcrashrecovery-final.pdf">Crash Recovery and Media Recovery in InnoDB</a></li>
<li>Heikki: <a href="http://www.innodb.com/wp/wp-content/uploads/2009/05/concurrencycontrol.pdf">Concurrency Control: How it Really Works</a></li>
<li>Calvin and Heikki: <a href="http://www.innodb.com/wp/wp-content/uploads/2009/05/innodb-file-formats-and-source-code-structure.pdf">InnoDB File Formats and Source Code Structure</a></li>
</ul>
<p>The description of these and other presentations about InnoDB are available <a href="http://www.innodb.com/products/innodb/info/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.innodb.com/wp/2009/05/innodb-conference-presentations-now-aonline/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Software is Hard Sometimes &#8230;</title>
		<link>http://blogs.innodb.com/wp/2009/03/software-is-hard-sometimes/</link>
		<comments>http://blogs.innodb.com/wp/2009/03/software-is-hard-sometimes/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 08:00:59 +0000</pubDate>
		<dc:creator>Vasil Dimov</dc:creator>
				<category><![CDATA[InnoDB Plugin]]></category>
		<category><![CDATA[Concurrency]]></category>
		<category><![CDATA[mutex]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[portability]]></category>
		<category><![CDATA[Scalability]]></category>

		<guid isPermaLink="false">http://blogs.innodb.com/wp/?p=350</guid>
		<description><![CDATA[Some months ago, Google released a patch for InnoDB that boosts performance on multi-core servers. We decided to incorporate the change into the InnoDB Plugin to make everybody happy: users of InnoDB don&#8217;t have to apply the patch, and Google no longer has to maintain the patch for new versions of InnoDB. And it makes [...]]]></description>
			<content:encoded><![CDATA[<p>Some months ago, Google released a <a href="http://code.google.com/p/google-mysql-tools/wiki/SmpPerformance">patch</a> for InnoDB that boosts performance on multi-core servers.  We decided to incorporate the change into the InnoDB Plugin to make everybody happy: users of InnoDB don&#8217;t have to apply the patch, and Google no longer has to maintain the patch for new versions of InnoDB.  And it makes us at Innobase happy because it improves our product (as you can in <a href="http://blogs.innodb.com/wp/2009/03/plug-in-for-performance-and-scalability/">this post</a> about InnoDB Plugin release 1.0.3).</p>
<p>However, there are always technical and business issues to address.  Given the low-level changes in the patch, was it technically sound?   Was the patch stable and as rock solid as is the rest of InnoDB?  Although it was written for the built-in InnoDB in MySQL 5.0.37, we needed to adapt it to the InnoDB Plugin. Could we make the patch portable to many platforms?   Could we incorporate the patch without legal risk (so it could be licensed under both the GPL and commercial terms)?</p>
<p>Fortunately Google generously donated the patch to us under the BSD license, so there was no concern about intellectual property (so long as we properly acknowledged the contribution, which we do in an Appendix to the manual and in the source code).  So, while the folks at Google are known for writing excellent code, we had to thoroughly review and test the patch before it could be incorporated in a release of InnoDB.</p>
<p>The patch improves performance by replacing InnoDB mutex and rw-mutex with atomic memory instructions. The first issue that arose was that the patch assigned the integer value -1 to a pthread_t variable, to refer to a neutral/non-existent thread identifier.  This approach worked for Google because they use InnoDB solely on Linux. As it happens, pthread_t is defined as an integer on Linux.</p>
<p>But we had problems when the patch was tested on FreeBSD.  We still needed to reference a non-existent thread, but in some environments (e.g. some versions of HPUX, Mac OS X) pthread_t is defined as a<br />
structure, not an integer.  As we looked at it, the problem became more complex.  For this scheme to work, it must be possible to change thread identifiers atomically, using a Compare-And-Swap instruction.  Otherwise, there will be subtle, mysterious and nasty failures.</p>
<p><span id="more-350"></span></p>
<p>We thought about enabling this patch only on Linux.  But that approach was not optimal, because the patch could work perfectly well on other platforms where pthread_t is the same size as the machine word, like FreeBSD and Solaris, for example.   We could have simply enumerated the operating system names where the patch would be supported, but this too was far from perfect.  The ability to use the atomic instructions depends not only on the operating system, but the GCC version (has to be 4.1 or newer) and the capabilities of the CPU (some CPUs do not support Compare-And-Swap!).</p>
<p>So, we developed a dynamic compile-time check for checking whether the target environment (pthread_t type and size, GCC version, CPU capabilities) supports the use of atomic instructions as intended. This seemed to be the best approach, but then another problem arose! </p>
<p>Dynamic compile-time checks (i.e. autoconf) are part of the MySQL&#8217;s ./configure script.  Innobase does not control this script, and so we must live with what is distributed by MySQL.  To make things simple for<br />
users, we wanted to avoid asking the users to re-create ./configure with the autotools. So we simply injected the required checks in the Makefile.  This seemed to work fine.   Only after release of the InnoDB Plugin 1.0.3 did a small crack in this approach arise.  Fortunately this problem turned out to be easy to fix and only occurs if one compiles with &#8220;make -j&#8221; (in order to perform the make in parallel). See <a href="http://bugs.mysql.com/43740">Bug#43740</a> for details and for a fix.</p>
<p>The bottom line is that sometimes more goes on &#8220;behind the scenes&#8221; than you might expect when it comes to incorporating a third-party contribution into a product.  We are grateful for the Google patch, and are glad that we have been able to include it in the InnoDB Plugin in a way that maximizes its portability, while keeping things as simple as possible for users.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.innodb.com/wp/2009/03/software-is-hard-sometimes/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Talk,Talk, Talk: Innobase Speaks</title>
		<link>http://blogs.innodb.com/wp/2009/03/talktalk-talk-mysql-conference-presentations/</link>
		<comments>http://blogs.innodb.com/wp/2009/03/talktalk-talk-mysql-conference-presentations/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 20:59:06 +0000</pubDate>
		<dc:creator>Ken Jacobs</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Compatibility]]></category>
		<category><![CDATA[Concurrency]]></category>
		<category><![CDATA[file form]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Recovery]]></category>

		<guid isPermaLink="false">http://blogs.innodb.com/wp/?p=253</guid>
		<description><![CDATA[That should read &#8220;Talks, Talks, Talks&#8221; &#8230; There will be several presentations by InnoDB experts at the upcoming 2009 MySQL Conference and Expo. Whether you&#8217;re a newbie or an experienced DBA deeply familiar with InnoDB, you won&#8217;t want to miss these important talks about InnoDB: Innovative Technologies for Performance and Data Protection by Ken and [...]]]></description>
			<content:encoded><![CDATA[<p>That should read &#8220;Talks, Talks, Talks&#8221; &#8230; There will be several presentations by InnoDB experts at the upcoming 2009 MySQL Conference and Expo.  Whether you&#8217;re a newbie or an experienced DBA deeply familiar with InnoDB, you won&#8217;t want to miss these important talks about InnoDB:</p>
<ul>
<li><a href="http://en.oreilly.com/mysql2009/public/schedule/detail/8877" target="new">Innovative Technologies for Performance and Data Protection</a> by Ken and Heikki, Tues, 11:55am</li>
<li><a href="http://en.oreilly.com/mysql2009/public/schedule/detail/6843" target="new">Crash Recovery and Media Recovery in InnoDB</a> by Heikki, Wed, 2pm</li>
<li><a href="http://en.oreilly.com/mysql2009/public/schedule/detail/7052" target="new">InnoDB Internals: InnoDB File Formats &#038; Source Code Structure</a> by Heikki and Calvin, Wed, 5:15pm</li>
<li><a href="http://en.oreilly.com/mysql2009/public/schedule/detail/6842" target="new">Concurrency Control: How it Really Works</a> by Heikki, Thurs, 2:50pm </li>
</ul>
<p>Note the <strong>new times</strong> for the last two talks above.  Be sure to check the conference schedule!  Not much more to say about this topic, at least not here.  Hear it all <a href="http://en.oreilly.com/mysql2009/public/content/home" target="new"><b>there</b></a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.innodb.com/wp/2009/03/talktalk-talk-mysql-conference-presentations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plug In for Performance and Scalability</title>
		<link>http://blogs.innodb.com/wp/2009/03/plug-in-for-performance-and-scalability/</link>
		<comments>http://blogs.innodb.com/wp/2009/03/plug-in-for-performance-and-scalability/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 22:00:41 +0000</pubDate>
		<dc:creator>Ken Jacobs</dc:creator>
				<category><![CDATA[InnoDB Plugin]]></category>
		<category><![CDATA[Built-in]]></category>
		<category><![CDATA[Concurrency]]></category>
		<category><![CDATA[Configuration parameter]]></category>
		<category><![CDATA[Hash index]]></category>
		<category><![CDATA[Insert buffer]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[Mutexes]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[Tuning]]></category>

		<guid isPermaLink="false">http://blogs.innodb.com/wp/?p=67</guid>
		<description><![CDATA[Why should you care about the latest &#8220;early adopter&#8221; release of the InnoDB Plugin, version 1.0.3?   One word: performance! The release introduces these features: Enhanced concurrency &#38; scalability: the “Google SMP patch” using atomic instructions for mutexing More efficient memory allocation: ability to use more scalable platform memory allocator Improved out-of-the-box scalability: unlimited concurrent [...]]]></description>
			<content:encoded><![CDATA[<p>Why should you care about the latest &#8220;early adopter&#8221; release of the InnoDB Plugin, version 1.0.3?   One word: <strong>performance!</strong> The release introduces these features:</p>
<ul>
<li>Enhanced concurrency &amp; scalability: the “Google SMP patch” using atomic instructions for mutexing</li>
<li>More efficient memory allocation: ability to use more scalable platform memory allocator</li>
<li>Improved out-of-the-box scalability: unlimited concurrent thread execution by default</li>
<li>Dynamic tuning: at run-time, enable or disable insert buffering and adaptive hash indexing</li>
</ul>
<p>These new performance features can yield <strong>up to twice the throughput</strong> or more, depending on your workload, platform and other tuning considerations.   In another post, we explore some details about these changes, but first, what do these enhancements mean for performance and scalability?</p>
<p>In brief, we&#8217;ve tested three different workloads (joins, DBT2 OLTP and a modified sysbench) using a memory-resident database.  In all cases, the InnoDB Plugin scales significantly better than the built-in InnoDB in MySQL 5.1.  And in some cases, the absolute level of performance is dramatically higher too!   The charts below illustrate the kinds of performance gains we&#8217;ve measured with release 1.0.3 of the InnoDB Plugin. Your mileage may vary, of course.  See the <a href="http://www.innodb.com/wp/innodb_plugin/plugin-performance">InnoDB website</a> for all the details on these tests.</p>
<p>This release of the InnoDB Plugin incorporates a <a href="http://code.google.com/p/google-mysql-tools/wiki/SmpPerformance" target="new">patch made by Ben Handy and Mark Callaghan at Google</a> to improve multi-core scalability by using more efficient synchronization methods (mutexing and rw-locks) to reduce cpu utilization and contention.   We&#8217;re grateful for this contribution, and you will be too!</p>
<p><span id="more-67"></span></p>
<p>Now to our test results &#8230;</p>
<p><strong>Joins: </strong>The following chart shows the performance gains in performing joins, comparing the built-in InnoDB in MySQL (in <span style="color:blue">blue</span>) with the InnoDB Plugin 1.0.3 (in <span style="color:red">red</span>).</p>
<div class="separator" style="clear: both; text-align: center;"><a style="margin-left: 1em;" href="http://spreadsheets.google.com/pub?key=ppe5byK5r-M54VD8dWLF0Vw&amp;oid=7&amp;output=image"><img src="http://spreadsheets.google.com/pub?key=ppe5byK5r-M54VD8dWLF0Vw&amp;oid=7&amp;output=image" border="0" alt="" width="400" height="250" /></a></div>
<p>As you can see from the blue bars in the above chart, with MySQL 5.1 using the built-in InnoDB, the total number of joins the system can execute declines as the number of concurrent users increases.   In contrast, the InnoDB Plugin slightly improves performance even with one user, and maintains performance as the number of users rises.   This performance improvement is due in large part to the use of atomics for mutexing in the InnoDB Plugin.</p>
<p><strong>Transaction Processing (DBT2):</strong> The following chart illustrates a scalability improvement using  the OLTP read/write DBT2 benchmark, again comparing the performance of <span style="color:blue">the built-in InnoDB in MySQL</span> with the performance of <span style="color:red">InnoDB Plugin 1.0.3</span>.</p>
<div class="separator" style="clear: both; text-align: center;"><a style="margin-left: 1em;" href="http://spreadsheets.google.com/pub?key=ppe5byK5r-M54VD8dWLF0Vw&amp;oid=8&amp;output=image"><img src="http://spreadsheets.google.com/pub?key=ppe5byK5r-M54VD8dWLF0Vw&amp;oid=8&amp;output=image" border="0" alt="" width="400" height="250" /></a></div>
<p>Here, the InnoDB Plugin scales better than the built-in InnoDB from 16 to 32 users and produces about 12% more throughput with 64 concurrent users, as other bottlenecks are encountered or system capacity is reached.  This improvement is likewise due primarily to the changes in mutexing.</p>
<p><strong>Modified Sysbench:</strong> This test uses a version of the well-known sysbench workload, modified to include queries based on a secondary index, <a href="http://mysqlha.blogspot.com/2009/02/update-for-sysbench.html">as suggested</a> by Mark Callaghan of Google.</p>
<div class="separator" style="clear: both; text-align: center;"><a style="margin-left: 1em;" href="http://spreadsheets.google.com/pub?key=ppe5byK5r-M54VD8dWLF0Vw&amp;oid=9&amp;output=image"><img src="http://spreadsheets.google.com/pub?key=ppe5byK5r-M54VD8dWLF0Vw&amp;oid=9&amp;output=image" border="0" alt="" width="400" height="250" /></a></div>
<p>This time, the InnoDB Plugin shows significantly better scalability from 8 to 64 users than the built-in InnoDB in MySQL, yielding as much as 60% more throughput at 64 users.  Like the previous examples, this improvement is largely due to the use of atomics for mutexing.</p>
<p><strong>Modified Sysbench with tcmalloc:</strong> This test uses the same modified sysbench workload, but shows the difference between the built-in InnoDB (which uses the internal InnoDB memory allocator) and the InnoDB Plugin when using a more scalable memory allocator, in this case <a href="http://google-perftools.googlecode.com/svn/trunk/doc/tcmalloc.html">tcmalloc</a>.</p>
<div class="separator" style="clear: both; text-align: center;"><a style="margin-left: 1em;" href="http://spreadsheets.google.com/pub?key=ppe5byK5r-M54VD8dWLF0Vw&amp;oid=10&amp;output=image"><img src="http://spreadsheets.google.com/pub?key=ppe5byK5r-M54VD8dWLF0Vw&amp;oid=10&amp;output=image" border="0" alt="" width="400" height="250" /></a></div>
<p>When the new configuration parameter <code>innodb_use_sys_malloc</code> is set to enable use of the memory allocator tcmalloc, the InnoDB Plugin really shines!  Transaction throughput continues to scale, and the actual throughput with 64 users has nearly doubled!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.innodb.com/wp/2009/03/plug-in-for-performance-and-scalability/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

