<?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>Toru Maesaka &#187; performance</title>
	<atom:link href="http://torum.net/tag/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://torum.net</link>
	<description>Hackaholic and a Web Addict based in Tokyo</description>
	<lastBuildDate>Tue, 28 Feb 2012 10:52:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>BlitzDB Concurrent Testing and Write Performance</title>
		<link>http://torum.net/2010/05/blitzdb-concurrency-testing/</link>
		<comments>http://torum.net/2010/05/blitzdb-concurrency-testing/#comments</comments>
		<pubDate>Wed, 12 May 2010 06:42:05 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[drizzle]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[blitzdb]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://torum.net/?p=2353</guid>
		<description><![CDATA[Last month while being at the MySQL Conference, several people asked me about the status of BlitzDB. Specifically, they were interested in when I&#8217;ll release BlitzDB. Fair enough &#8211; I&#8217;ve been working on this project long enough for people to start questioning this. The answer is, BlitzDB is done in terms of implementing the design. [...]]]></description>
			<content:encoded><![CDATA[<p>Last month while being at the MySQL Conference, several people asked me about the status of BlitzDB. Specifically, they were interested in when I&#8217;ll release BlitzDB. Fair enough &#8211; I&#8217;ve been working on this project long enough for people to start questioning this.</p>
<p>The answer is, BlitzDB is done in terms of implementing the design. Right now it&#8217;s about finding bugs, fixing it and testing BlitzDB&#8217;s stability under concurrent load. Thanks to the motivation boost I gained at the conference, I&#8217;ve now fixed the bugs that were slowing me down and I&#8217;m gradually adding more tests into BlitzDB&#8217;s test suite. I consider BlitzDB&#8217;s initial release to be the day it gets merged into Drizzle&#8217;s trunk. This is almost ready as BlitzDB seems to be building fine on Drizzle&#8217;s Build Farm infrastructure. However, I won&#8217;t move to the next step until I&#8217;m satisfied with BlitzDB&#8217;s stability.</p>
<p>Yesterday I spent some time doing some concurrency testing on BlitzDB&#8217;s INSERT code with skyload. Needless to say, concurrency testing is also a convenient way to look at the performance of a particular component. So, I decided to publish my findings from this test. First, here is the background of the test.</p>
<h3>Purpose of the Test</h3>
<ul>
<li>Test BlitzDB&#8217;s slot-lock mechanism.</li>
<li>Confirm that BlitzDB will not crash under concurrent INSERT workload.</li>
<li>Confirm that key insertion to the index is working as expected.</li>
<li>Confirm that writes to multiple indexes work as expected.</li>
<li>Observe the write-performance impact of adding an index.</li>
</ul>
<p>Two commodity boxes were used. One dedicated for the client and the other dedicated for the server (Drizzle + BlitzDB). Both boxes has the same spec: Intel Quad Xeon E5345 (2×4MB L2 cache), 8GB Memory, 500GB SATA II, gigabit NIC. Servers were connected by a gigabit switch. File system on the server was ext3.</p>
<p>By default, a BlitzDB table is optimized for up to 1 million rows. Therefore this test inserted 1 million rows to a table with different concurrency levels. A different concurrency level is used per run. The table used in this test only contains three integer columns. Tests are performed up to three indexes. The linux kenel&#8217;s dirty buffer is flushed before each test run. Tests were run until the performance curve flattened.</p>
<h3>Result</h3>
<p align="center"><a href="http://www.flickr.com/photos/tmaesaka/4598572902/" title="BlitzDB Table Insertion - Multi Index by tmaesaka, on Flickr"><img src="http://farm2.static.flickr.com/1324/4598572902_c1e45d7ac5.jpg" width="500" height="294" alt="BlitzDB Table Insertion - Multi Index" /></a></p>
<p>As seen above, scalability from 1 thread to 4 thread showed an ideal curve. This is expected since the server is a 4 core box. From 4 threads, performance showed some improvements up to 12 threads. From there on, concurrency greatly exceeds the number of physical cores so we can&#8217;t observe decent performance growth. The highest insert QPS gained in this test was <strong>just over 86,000 QPS</strong>. With more cores on the server and more clients, I suspect BlitzDB can hit over 100k QPS.</p>
<p>Although this graph looks good at first sight, I&#8217;m not happy with it. The performance penalty for adding multiple indexes should be greater than what&#8217;s observed in this result. This is because TC&#8217;s B+Tree is internally protected by a single lock on writes. I suspect that the performance penalty is not observed in this graph because I didn&#8217;t give BlitzDB enough load to make TC work hard. This implies that a bottleneck could exist elsewhere (Network, Drizzle or BlitzDB&#8217;s handler level code).</p>
<p>However, I&#8217;m glad that BlitzDB stood stable on this concurrency test which was what I wanted to test in the first place. Admittedly I need to mix several types of queries to properly test BlitzDB&#8217;s stability. I plan on doing this next with sysbench and hopefully <a href="https://launchpad.net/randgen">RQG</a>.</p>
<p>Once this is done, I&#8217;ll submit a merge proposal to the Drizzle Project :)</p>
<h3>Future Development Plans</h3>
<ul>
<li>Find bugs, Fix bugs, Repeat.</li>
<li>Write an inbuilt auto recovery routine.</li>
<li>Eventually add a crash safe option to BlitzDB.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2010/05/blitzdb-concurrency-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fascinating libdrizzle benchmark results</title>
		<link>http://torum.net/2009/04/fascinating-libdrizzle-benchmark-results/</link>
		<comments>http://torum.net/2009/04/fascinating-libdrizzle-benchmark-results/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 01:53:31 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[drizzle]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[libdrizzle]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://torum.net/?p=939</guid>
		<description><![CDATA[Spreading the word about Jay&#8217;s awesome findings on the libdrizzle benchmark against the original library inherited from MySQL. For those that aren&#8217;t familiar with libdrizzle, it is a fresh new (modern implementation) MySQL compatible client library for Drizzle that leverages asynchronous I/O and smarter memory usage founded by Eric Day. You can read how this [...]]]></description>
			<content:encoded><![CDATA[<p>Spreading the word about<a href="http://www.jpipes.com/index.php?/archives/289-Libdrizzle-Benchmarks-Massive-Performance-Increases.html"> Jay&#8217;s awesome findings</a> on the libdrizzle benchmark against the original library inherited from MySQL. For those that aren&#8217;t familiar with libdrizzle, it is a fresh new (modern implementation) MySQL compatible client library for <a href="https://launchpad.net/drizzle">Drizzle</a> that leverages asynchronous I/O and smarter memory usage founded by <a href="http://www.oddments.org/">Eric Day</a>.</p>
<p>You can read how this library came to life in this thread:</p>
<ul>
<li><a href="https://lists.launchpad.net/drizzle-discuss/msg00472.html">https://lists.launchpad.net/drizzle-discuss/msg00472.html</a></li>
</ul>
<p>As you can see in Jay&#8217;s findings with sysbench, libdrizzle outperforms the original library in all concurrency levels by a rather significant figure (e.g. 41.16% performance increase at only two threads). If you&#8217;re interested in gaining more performance from Drizzle or MySQL in the future, you should really start looking into this library now.</p>
<p>This was the first blog entry I read this morning and hey, it really kick started my day. Eric you rock! and thanks to Jay for sharing his findings.</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2009/04/fascinating-libdrizzle-benchmark-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rethinking the Query Cache for Drizzle</title>
		<link>http://torum.net/2008/10/rethink-query-cache-drizzle/</link>
		<comments>http://torum.net/2008/10/rethink-query-cache-drizzle/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 07:54:02 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[drizzle]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://torum.net/?p=423</guid>
		<description><![CDATA[There is a mutual understanding in the Drizzle community that the MySQL query cache works well for a small database but isn&#8217;t sufficient for relatively large scale usages. Does your application involve a lot of database updates? if so, you&#8217;ll probably face fragmentation issues in the query cache (though using the query cache isn&#8217;t suitable [...]]]></description>
			<content:encoded><![CDATA[<p>There is a mutual understanding in the Drizzle community that the MySQL query cache works well for a small database but isn&#8217;t sufficient for relatively large scale usages. Does your application involve a lot of database updates? if so, you&#8217;ll probably face fragmentation issues in the query cache (though using the query cache isn&#8217;t suitable for use cases like this).</p>
<p>Caching is the key ingredient in boosting the performance of any software that requires significant amount of computation, hence it is something that can&#8217;t be overlooked. So how can we improve Drizzle?</p>
<p>The idea is to create a pluggable query cache subsystem that can work in a large scale environment. Drizzle, being a micro-kernel DBMS, it makes sense to make the cache component pluggable and let the DBA choose the caching solution of their choice. This is exactly what I&#8217;m working on at the moment and my first plugin will allow Drizzle to use memcached as its query cache.</p>
<p>For example, a DBA could hook up their memcached pool to Drizzle and use several gigabytes of fast cache space to cache their results.</p>
<h3><strong>Things to consider</strong></h3>
<ul>
<li>Does the DBA really want to cache results?</li>
<li>Does the result construction take long enough to care?</li>
<li>Do we want to specify a specific SQL statement to always cache?</li>
<li>Do we want to enforce a certain table to be cached?</li>
<li>Transactional Engines</li>
</ul>
<p>If we can satisfy the above points and achieve modularity, I think its a total win. For those that like diagrams, here is the architecture that is on my mind at the moment:</p>
<p style="border: 0; text-align: center;"> <a title="Drizzle Query Cache Plugin Example by tmaesaka, on Flickr" href="http://www.flickr.com/photos/tmaesaka/2927969599/"><img class="aligncenter" src="http://farm4.static.flickr.com/3042/2927969599_11f887a2ec.jpg" border="0" alt="Drizzle Query Cache Plugin Example" width="500" height="343" border:"0" /></a></p>
<h3><strong>Benefits of using memcached</strong></h3>
<p>memcached is proven to work and help scale web applications in a cost effective fashion by various players in the web industry. It is also fast. The time complexity of fetching a cached result from memcached is O(1), which is an order we all love. Furthermore, by using memcached, the fragmentation issue disappears since this is a problem that the memcached community had to face in the past and successfully overcame by developing the slab subsystem.</p>
<p>Want to scale? with consistent hashing enabled, you can greatly reduce the number of cache misses from adding/removing a node from a live pool. Got spare boxes lying around? hook them up and powerup Drizzle! Need support? both memcached and Drizzle community members are heartwarming people.</p>
<h3><strong>Other Solutions work Too!</strong></h3>
<p>The beauty of modularity is that you can create and use your own solution for your unique requirements. For example lets assume that there is a webshop that wants to keep the number of physical servers down (e.g. limited monetary/space resource).</p>
<p>To satisfy the requirement stated above, you could cache to a fantastically fast hash database, such as Tokyo Cabinet (much, much faster than BDB). If you haven&#8217;t heard of it, you should look at the incredible <a href="http://tokyocabinet.sourceforge.net/benchmark.pdf">benchmark comparison</a>). So, what I really wanted to say is that the microkernel property of Drizzle will open up a lot of new possibilities for your application and help you tackle the new requirements that seem to come out of no where.</p>
<h3><strong>Where from here?</strong></h3>
<p>Currently going through the UDF -> Plugin Architecture conversion done by <a href="http://fallenpegasus.com/">Mark</a>, and planning on basing the code on his logging plugin while its fantastically simple. My work will be done in:</p>
<ul>
<li>lp:~tmaesaka/drizzle/pluggable-qcache</li>
</ul>
<p>I&#8217;ll hopefully have something decent to show soon, and I will keep people updated on my blog, <a href="irc://irc.freenode.net/drizzle">IRC</a> and the <a href="https://launchpad.net/~drizzle-discuss">Mailing List</a> (drizzle-discuss).</p>
<p>So that is all I have to say for now&#8230; If you have any suggestions, please do enlighten me :)</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2008/10/rethink-query-cache-drizzle/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

