<?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>Severalnines</title>
	<atom:link href="http://www.severalnines.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.severalnines.com/blog</link>
	<description>All things highly available and clustered</description>
	<lastBuildDate>Wed, 28 Apr 2010 15:35:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MySQL Cluster &#8211; SPJ Preview &#8211; Feedback welcome SPJ</title>
		<link>http://www.severalnines.com/blog/2010/04/mysql-cluster-spj-preview-feedback-welcome-spj/</link>
		<comments>http://www.severalnines.com/blog/2010/04/mysql-cluster-spj-preview-feedback-welcome-spj/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 15:35:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL Cluster]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[SPJ]]></category>

		<guid isPermaLink="false">http://www.severalnines.com/blog/?p=35</guid>
		<description><![CDATA[SPJ (preview, not  production ready) is a new feature allowing some types of JOINs to be  pushed down and executed inside the data nodes!  This allows for, in  many cases, much faster JOIN execution.
Now we would love to get  your feedback on this new feature:

Does what we have right now [...]]]></description>
			<content:encoded><![CDATA[<p>SPJ (preview,<span style="font-weight: bold;"> not  production ready</span>) is a new feature allowing some types of JOINs to be  pushed down and executed inside the data nodes!  This allows for, in  many cases, much faster JOIN execution.</p>
<p><span style="font-weight: bold;">Now we would love to get  your feedback on this new feature:</span></p>
<ul>
<li>Does what we have right now  improve performance for you?</li>
<li>Are there other types of JOINs we should  support in order to improve performance in you application (currently  only eq_ref is supported)?</li>
<li>What application are you using?</li>
</ul>
<p><span style="font-weight: bold;">There are  some  limitations currently:</span></p>
<ul>
<li>node failure handling of SPJ is not   complete, so if a data node crash, there are side-effects.</li>
<li>only eq_ref is  supported &#8211; other JOINs are executed as normal.</li>
<li>Don&#8217;t put this in production.</li>
</ul>
<p><span style="font-weight: bold;">Obtaining the MySQL Cluster SPJ preview version:</span></p>
<ul>
<li>You must  know how to build MySQL Cluster from source</li>
<li><a href="http://www.severalnines.com/config">www.severalnines.com/config</a> includes &#8220;7.1 SPJ Preview&#8221; (the scripts will compile and distribute the binaries for you)  &#8211; just select &#8220;MySQL Cluster 7.1.3-SPJ&#8221; from the Cluster Version drop down.</li>
<li>The source code (if you don&#8217;t use severalnines/config) can be found <a href="ftp://ftp.mysql.com/pub/mysql/download/cluster_telco/mysql-5.1.44-ndb-7.1.3-spj-preview/mysql-cluster-gpl-7.1.3-spj-preview.tar.gz">here</a>.</li>
</ul>
<p><span style="font-weight: bold;">How to test is:</span></p>
<ul>
<li>Run a JOIN query:<br />
<code>mysql&gt; set ndb_join_pushdown=0; </code><br />
<code>mysql&gt; run join query </code><br />
<code>mysql&gt; set ndb_join_pushdown=1; //ENABLES SPJ</code><br />
<code>mysql&gt; run join query again </code><br />
Did it help?</li>
<li>Run EXPLAIN on the queries (especially if SPJ did not help)</li>
</ul>
<p><span style="font-weight: bold;">Feedback:</span></p>
<ul>
<li>Send us the EXPLAINs of the queries where SPJ did not help!<br />
or</li>
<li>Let us know if this feature was helpful for your application.<br />
and in any case please include</li>
<li>What kind of speed up (or decrease) was observed</li>
<li>What kind of cluster configuration/hw was used.</li>
</ul>
<p>Please send your feedback to us: <code>spj-feedback (at) sun (dot) com</code> .  Thank you!</p>
<p><span style="font-weight: bold;">Read more about SPJ:</span></p>
<ul>
<li>More details about SPJ is in <a href="http://assets.en.oreilly.com/1/event/36/MySQL%20Cluster%20and%20Pushdown-joins%20_In%20Pursuit%20of%20the%20Holy%20Grail_%20Presentation.pdf">Jonas&#8217;  MySQL UC 2010 presentation</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.severalnines.com/blog/2010/04/mysql-cluster-spj-preview-feedback-welcome-spj/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tuning your Cluster with ndbinfo (7.1) part 1 of X</title>
		<link>http://www.severalnines.com/blog/2010/04/tuning-your-cluster-with-ndbinfo-7-1-part-1-of-x/</link>
		<comments>http://www.severalnines.com/blog/2010/04/tuning-your-cluster-with-ndbinfo-7-1-part-1-of-x/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 23:51:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL Cluster]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[MySQL Cluster 7.1]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://www.severalnines.com/blog/?p=31</guid>
		<description><![CDATA[The new ndbinfo interface in 7.1 is really useful to assist in tuning MySQL Cluster. Here is an example (more will follow):
I started with one test where I inserted two blobs (1KB + 1KB) in one table.
From 16 threads (colocated with one mysqld, two data nodes, separate computers) and one application driving the load I [...]]]></description>
			<content:encoded><![CDATA[<p>The new ndbinfo interface in 7.1 is really useful to assist in tuning MySQL Cluster. Here is an example (more will follow):</p>
<p>I started with one test where I inserted two blobs (1KB + 1KB) in one table.<br />
From 16 threads (colocated with one mysqld, two data nodes, separate computers) and one application driving the load I reached about <span style="font-weight: bold;">6960TPS</span>, and the utilization of the redo buffers (controlled by the parameter <code>RedoBuffer</code> in config.ini) looked like:</p>
<pre style="border: 1px dashed #999999; padding: 5px; overflow: auto; color: #000000; background-color: #eeeeee; line-height: 14px; width: 100%; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px;">mysql&lt; select * from ndbinfo.logbuffers;
+---------+----------+--------+----------+----------+--------+
| node_id | log_type | log_id | log_part | total    | used   |
+---------+----------+--------+----------+----------+--------+
|       3 | REDO     |      0 |        1 | 50331648 | 196608 |
|       3 | REDO     |      0 |        2 | 50331648 | 294912 |
|       3 | REDO     |      0 |        3 | 50331648 | 131072 |
|       3 | REDO     |      0 |        4 | 50331648 | 229376 |
|       4 | REDO     |      0 |        1 | 50331648 | 229376 |
|       4 | REDO     |      0 |        2 | 50331648 | 262144 |
|       4 | REDO     |      0 |        3 | 50331648 | 163840 |
|       4 | REDO     |      0 |        4 | 50331648 | 229376 |
+---------+----------+--------+----------+----------+--------+
8 rows in set (0.01 sec)
</pre>
<p>Which is basically nothing.</p>
<p>I then increased the load and inserted<span style="font-weight: bold;"> 2 x 5120B BLOBs</span> (from 16 threads one MySQL server), and run with an insert speed of <span style="font-weight: bold;">4320TPS</span>:</p>
<pre style="border: 1px dashed #999999; padding: 5px; overflow: auto; color: #000000; background-color: #eeeeee; line-height: 14px; width: 100%; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px;">mysql&lt; select * from ndbinfo.logbuffers;
+---------+----------+--------+----------+----------+----------+
| node_id | log_type | log_id | log_part | total    | used     |
+---------+----------+--------+----------+----------+----------+
|       3 | REDO     |      0 |        1 | 50331648 | 11468800 |
|       3 | REDO     |      0 |        2 | 50331648 | 31522816 |
|       3 | REDO     |      0 |        3 | 50331648 | 42008576 |
|       3 | REDO     |      0 |        4 | 50331648 | 43057152 |
|       4 | REDO     |      0 |        1 | 50331648 | 14090240 |
|       4 | REDO     |      0 |        2 | 50331648 | 17432576 |
|       4 | REDO     |      0 |        3 | 50331648 | 10321920 |
|       4 | REDO     |      0 |        4 | 50331648 | 12615680 |
+---------+----------+--------+----------+----------+----------+</pre>
<p>Above you can see that the redo buffers are used (the load will be spread around, and it is hard to catch a moment where the load is even on all buffers), and now the application started to throw the error <code>"Got temporary error 1221 'REDO buffers overloaded (increase RedoBuffer)' from NDBCLUSTER (1297)"</code></p>
<p>I can now follow the instruction to increase the REDO buffer, but would it help in this case?<br />
No, no and no.<br />
The disk is too slow to keep up and cannot write out to disk in the same rate as the application writes out.</p>
<p>&#8216;iostat&#8217; gives:</p>
<pre style="border: 1px dashed #999999; padding: 5px; overflow: auto; color: #000000; background-color: #eeeeee; line-height: 14px; width: 100%; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px;">&lt; iostat -kx 1

Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util
cciss/c0d0        0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
cciss/c0d1        0.00 27796.00    0.00 1454.00     0.00 115196.00   158.45    12.03    8.25   0.66  95.30
dm-0              0.00     0.00    0.00 29270.00     0.00 117080.00     8.00   274.79    9.33   0.03  95.20
dm-1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
dm-2              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
dm-3              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
dm-4              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
dm-5              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
</pre>
<p>And here you can see that the disks are quite utilized. This means that I have two options now if I want to be able to sustain the 4320TPS insert load:</p>
<ul>
<li>Increase the number of data nodes (computers) so instead of having two computers, I should have four so that I spread the load across more hardware</li>
<li>Improve my disk subsystem (add better disks, e.g,  to have 2-4 disk spindles to spread the load on), or by having the REDO log on device  cciss/c0d1 and the the LCP on device cciss/c0d0.</li>
</ul>
<p>The CPU, could that also been an bottleneck in this case? No, it was not the issue. The CMVMI thread (one of the data nodes threads) was spending 44.4% polling data from the other nodes, and it is reading in quite large packets so that is why it was the heaviest user of CPU of the data node threads.</p>
<pre style="border: 1px dashed #999999; padding: 5px; overflow: auto; color: #000000; background-color: #eeeeee; line-height: 14px; width: 100%; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px;">5453 root      20   0 6594m 4.1g 6956 R 44.4 51.9   4:05.64 ndbmtd
5471 root      20   0 6594m 4.1g 6956 S 32.5 51.9   3:39.07 ndbmtd
5474 root      20   0 6594m 4.1g 6956 R 26.6 51.9   2:25.55 ndbmtd
5475 root      20   0 6594m 4.1g 6956 S 23.7 51.9   2:25.01 ndbmtd
5476 root      20   0 6594m 4.1g 6956 R 23.7 51.9   2:20.83 ndbmtd
5473 root      20   0 6594m 4.1g 6956 R 21.7 51.9   2:26.57 ndbmtd
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.severalnines.com/blog/2010/04/tuning-your-cluster-with-ndbinfo-7-1-part-1-of-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Cluster UC 2010 sessions</title>
		<link>http://www.severalnines.com/blog/2010/04/mysql-cluster-uc-2010-sessions/</link>
		<comments>http://www.severalnines.com/blog/2010/04/mysql-cluster-uc-2010-sessions/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 19:41:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL Cluster]]></category>

		<guid isPermaLink="false">http://www.severalnines.com/blog/?p=27</guid>
		<description><![CDATA[My MySQL UC 2010 talks can be found here:

MySQL Cluster Performance Tuning
MySQL Cluster Deployment Best Practices

Or here (in case the above is not working) go here.
]]></description>
			<content:encoded><![CDATA[<p>My MySQL UC 2010 talks can be found here:</p>
<ul>
<li><a href="http://assets.en.oreilly.com/1/event/36/%20MySQL%20Cluster%20Performance%20Tuning%20Best%20Practices%20Presentation%201.pdf">MySQL Cluster Performance Tuning</a></li>
<li><a href="http://assets.en.oreilly.com/1/event/36/MySQL%20Cluster%20-%20Deployment%20Best%20Practices%20Presentation.pdf">MySQL Cluster Deployment Best Practices</a></li>
</ul>
<p>Or here (in case the above is not working) go<a href="http://www.severalnines.com/library.php"> here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.severalnines.com/blog/2010/04/mysql-cluster-uc-2010-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BLOB and ndb_auto_increment performance</title>
		<link>http://www.severalnines.com/blog/2010/04/blob-and-ndb_auto_increment-performance/</link>
		<comments>http://www.severalnines.com/blog/2010/04/blob-and-ndb_auto_increment-performance/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 13:18:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL Cluster]]></category>

		<guid isPermaLink="false">http://www.severalnines.com/blog/?p=23</guid>
		<description><![CDATA[At the UC 2010 I will have a session on MySQL Cluster Performance Tuning. This session will address a lot of the most common performance problems I see in my day to day job with Cluster. A small excerpt of the talk is below here and many other things will be addressed in the session [...]]]></description>
			<content:encoded><![CDATA[<p>At the UC 2010 I will have a session on <a href="http://en.oreilly.com/mysql2010/public/schedule/detail/12445">MySQL Cluster Performance Tuning</a>. This session will address a lot of the most common performance problems I see in my day to day job with Cluster. A small excerpt of the talk is below here and many other things will be addressed in the session (JOINs, schema optimization, batching, indexes, parameter tuning etc). I hope to see you there!</p>
<h2>ndb_autoincrement_prefetch_sz</h2>
<p>One thing is contention on auto_increments, which can really slow down performance.<br />
By default the <code>ndb_autoincrement_prefetch_sz=1</code>. This means that the mysqld will cache one auto_increment number and then go down to the data nodes to fetch the next number. It is better to let the mysqld cache more numbers, to avoid the unnecessary round-trip.</p>
<p>From MySQL Cluster 7.0.13 you can set it up to 65536 (previously max was 256)</p>
<p>With <code>ndb_autoincrement_prefetch_sz=1024</code> the mysqld will cache 1024 numbers before fetching the next range of numbers from the data nodes.</p>
<p>Som numbers for inserting batches of 16 records from 8 concurrent threads on one mysqld:</p>
<pre style="border: 1px dashed #999999; padding: 5px; overflow: auto; color: #000000; background-color: #eeeeee; line-height: 14px; width: 100%; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px;">ndb_autoincrement_prefetch_sz=1:                1211.91TPS
ndb_autoincrement_prefetch_sz=256:              3471.71TPS
ndb_autoincrement_prefetch_sz=1024:             3659.52TPS</pre>
<p>Here we got an 3x improvement on INSERT performance. Nice!</p>
<p>This test is by no means trying to max out the cluster, far from it, just  to illustrate how important it is to set the <code>ndb_autoincrement_prefetch_sz</code>.</p>
<h2>BLOB/TEXT</h2>
<p>Another is on <code>BLOB/TEXT</code> attributes &#8211; which in many cases are overused in applications (e.g, there is no reason to store an &#8216;email&#8217; as a TEXT, or if the data is less than about 8000B).</p>
<p>If you can change them to VARBINARY/VARCHAR (<a href="http://blogs.sun.com/LinuxJedi/entry/blobs_in_mysql_cluster">as LinuxJedi suggests</a>), do it:</p>
<p><code>BLOBs/TEXTs</code> are significantly slower compared to <code>VARBINARY/VARCHAR</code> (because the <code>BLOBs</code> are stored in a separate table, and need to be locked with at least a  shared lock when accessed).</p>
<pre style="border: 1px dashed #999999; padding: 5px; overflow: auto; color: #000000; background-color: #eeeeee; line-height: 14px; width: 100%; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px;">CREATE TABLE `t1_blob` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`data1` blob,
`data2` blob,
PRIMARY KEY (`id`)
)ENGINE=ndbcluster
</pre>
<p>and inserted 200K records. sizeof(data1) = 1024B, sizeof(data2) = 1024B.</p>
<p><code>SELECT data1, data2 FROM t1 WHERE id=&lt;rand&gt;</code></p>
<p>Executed from 1 App &#8211; 8 Threads on one MySQLD and two data nodes resulted in:</p>
<p>data1 and data2 represented as BLOBs : 5844 TPS<br />
data1 and data2 represented as VARBINARYs: <strong>19206 TPS</strong></p>
<p>Again, this is not maxing out the data nodes, just to show you the idea.</p>
<p>Conclusion<br />
If you can replace <code>TEXT/BLOB</code> with <code>VARCHAR/VARBINARY</code> (remember that the max record size in Cluster is 8052B)  do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.severalnines.com/blog/2010/04/blob-and-ndb_auto_increment-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Cluster 6.3.33/7.0.14</title>
		<link>http://www.severalnines.com/blog/2010/04/mysql-cluster-6-3-337-0-14/</link>
		<comments>http://www.severalnines.com/blog/2010/04/mysql-cluster-6-3-337-0-14/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 06:55:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL Cluster]]></category>
		<category><![CDATA[Configurator]]></category>

		<guid isPermaLink="false">http://www.severalnines.com/blog/?p=16</guid>
		<description><![CDATA[.. has been released. You should upgrade.
6.3:
ftp://ftp.mysql.com/pub/mysql/download/cluster_telco/mysql-5.1.44-ndb-6.3.33/mysql-cluster-gpl-6.3.33.tar.gz
7.0:

ftp://ftp.mysql.com/pub/mysql/download/cluster_telco/mysql-5.1.44-ndb-7.0.14/mysql-cluster-gpl-7.0.14.tar.gz
To upgrade:

CC=gcc CXX=g++ CFLAGS="-fpic" ./configure --without-libwrap --enable-static=yes --with-plugins=max --prefix=/usr/local/mysql/ --bindir=/usr/local/mysql//bin --libexecdir=/usr/local/mysql//bin
make -j4
make bin-dist

This gives you a binary tar ball (mysql-5.1.44...something.tar.gz)
and you can do:

cd mysqlcluster-70/cluster/scripts/install
./install-cluster /path/to/binary/that/you/did/above
cd..
./rolling-restart.sh

And you will have upgraded your Cluster. I am going to make the upgrade path easier.
]]></description>
			<content:encoded><![CDATA[<p>.. has been released. You should upgrade.</p>
<p>6.3:<br />
<a href="ftp://ftp.mysql.com/pub/mysql/download/cluster_telco/mysql-5.1.44-ndb-7.0.14/mysql-cluster-gpl-7.0.14.tar.gz">ftp://ftp.mysql.com/pub/mysql/download/cluster_telco/mysql-5.1.44-ndb-6.3.33/mysql-cluster-gpl-6.3.33.tar.gz</a><br />
7.0:<br />
<a href="ftp://ftp.mysql.com/pub/mysql/download/cluster_telco/mysql-5.1.44-ndb-7.0.14/mysql-cluster-gpl-7.0.14.tar.gz"><br />
ftp://ftp.mysql.com/pub/mysql/download/cluster_telco/mysql-5.1.44-ndb-7.0.14/mysql-cluster-gpl-7.0.14.tar.gz</a></p>
<p>To upgrade:</p>
<pre>
CC=gcc CXX=g++ CFLAGS="-fpic" ./configure --without-libwrap --enable-static=yes --with-plugins=max --prefix=/usr/local/mysql/ --bindir=/usr/local/mysql//bin --libexecdir=/usr/local/mysql//bin
make -j4
make bin-dist

<strong>This gives you a binary tar ball (mysql-5.1.44...something.tar.gz)
and you can do:
</strong>
cd mysqlcluster-70/cluster/scripts/install
./install-cluster /path/to/binary/that/you/did/above
cd..
./rolling-restart.sh
</pre>
<p>And you will have upgraded your Cluster. I am going to make the upgrade path easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.severalnines.com/blog/2010/04/mysql-cluster-6-3-337-0-14/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
