<?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>Tim[后端技术] &#187; memcachedb</title>
	<atom:link href="http://timyang.net/tag/memcachedb/feed/" rel="self" type="application/rss+xml" />
	<link>http://timyang.net</link>
	<description>Tim&#039;s blog, 关于后端架构、互联网技术、分布式、大型网络应用、NoSQL、Key Value等</description>
	<lastBuildDate>Mon, 02 Aug 2010 15:34:40 +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>MemcacheDB, Tokyo Tyrant, Redis performance test</title>
		<link>http://timyang.net/data/mcdb-tt-redis/</link>
		<comments>http://timyang.net/data/mcdb-tt-redis/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 12:16:58 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[data]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[memcachedb]]></category>
		<category><![CDATA[redis]]></category>
		<category><![CDATA[tokyo cabinet]]></category>
		<category><![CDATA[tokyo tyrant]]></category>

		<guid isPermaLink="false">http://timyang.net/?p=361</guid>
		<description><![CDATA[I had tested the following key-value store for set() and get()

MemcacheDB, use memcached client protocol.
Tokyo Tyrant (Tokyo Cabinet), use memcached client protocol
Redis, use JRedis Java client

1. Test environment
1.1 Hardware/OS
2 Linux boxes in a LAN, 1 server and 1 test client
Linux Centos 5.2 64bit
Intel(R) Xeon(R) CPU E5410  @ 2.33GHz (L2 cache: 6M), Quad-Core * 2
8G memory
SCSI [...]]]></description>
			<content:encoded><![CDATA[<p>I had tested the following key-value store for set() and get()</p>
<ul>
<li><a href="http://memcachedb.org/">MemcacheDB</a>, use memcached client protocol.</li>
<li><a href="http://tokyocabinet.sourceforge.net/tyrantdoc/">Tokyo Tyrant</a> (<a href="http://tokyocabinet.sourceforge.net/">Tokyo Cabinet</a>), use memcached client protocol</li>
<li><a href="http://code.google.com/p/redis/">Redis</a>, use <a href="http://code.google.com/p/jredis/">JRedis</a> Java client</li>
</ul>
<h2>1. Test environment</h2>
<h3>1.1 Hardware/OS</h3>
<p>2 Linux boxes in a LAN, 1 server and 1 test client<br />
Linux Centos 5.2 64bit<br />
Intel(R) Xeon(R) CPU E5410  @ 2.33GHz (L2 cache: 6M), Quad-Core * 2<br />
8G memory<br />
SCSI disk (standalone disk, no other access)</p>
<h3>1.2 Software version</h3>
<p>db-4.7.25.tar.gz<br />
libevent-1.4.11-stable.tar.gz<br />
memcached-1.2.8.tar.gz<br />
memcachedb-1.2.1-beta.tar.gz<br />
redis-0.900_2.tar.gz<br />
tokyocabinet-1.4.9.tar.gz<br />
tokyotyrant-1.1.9.tar.gz</p>
<h3>1.3 Configuration</h3>
<p><strong>Memcachedb startup parameter</strong><br />
Test 100 bytes<br />
./memcachedb -H /data5/kvtest/bdb/data -d -p 11212 -m 2048 <strong>-N -L 8192</strong><br />
(Update: As mentioned by <a href="http://stvchu.org/">Steve</a>, the 100-byte-test missed the -N paramter, so I added it and updated the data)<br />
Test 20k bytes<br />
./memcachedb -H /data5/kvtest/mcdb/data -d -p 11212 -b 21000 -N -m 2048</p>
<p><strong>Tokyo Tyrant (Tokyo Cabinet) configuration</strong><br />
Use default Tokyo Tyrant sbin/ttservctl<br />
use .tch database, hashtable database</p>
<p>ulimsiz=&#8221;256m&#8221;<br />
sid=1<br />
dbname=&#8221;$basedir/casket.tch#bnum=50000000&#8243; # default 1M is not enough!<br />
maxcon=&#8221;65536&#8243;<br />
retval=0</p>
<p><strong>Redis configuration</strong><br />
timeout 300<br />
save 900 1<br />
save 300 10<br />
save 60 10000<br />
# no maxmemory settings</p>
<h3>1.4 Test client</h3>
<p>Client in Java, JDK1.6.0, 16 threads<br />
Use Memcached client java_memcached-release_2.0.1.jar<br />
<a href="http://code.google.com/p/jredis/">JRedis</a> client for Redis test, another <a href="http://code.google.com/p/jdbc-redis/">JDBC-Redis</a> has poor performance.</p>
<h2>2. Small data size test result</h2>
<p>Test 1, 1-5,000,000 as key, 100 bytes string value, do set, then get test, all get test has result.<br />
Request per second(mean)<img class="alignnone size-full wp-image-374" title="key-value-performance-1(Update)" src="http://timyang.net/blog/wp-content/uploads/2009/08/key-value-performance-11.png" alt="key-value-performance-1(Update)" width="652" height="401" /></p>
<table style="width: 270pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0" width="359">
<colgroup span="1">
<col style="width: 130pt;" span="1" width="173"></col>
<col style="width: 70pt;" span="2" width="93"></col>
</colgroup>
<tbody>
<tr style="height: 15.75pt;" height="21">
<td class="xl25" style="border: medium none #d4d0c8; width: 130pt; height: 15.75pt; background-color: transparent;" width="173" height="21"><span style="font-size: small; font-family: Times New Roman;"><strong>Store</strong></span></td>
<td class="xl25" style="border: medium none #d4d0c8; width: 70pt; background-color: transparent;" width="93"><span style="font-size: small; font-family: Times New Roman;"><strong>Write</strong></span></td>
<td class="xl25" style="border: medium none #d4d0c8; width: 70pt; background-color: transparent;" width="93"><strong><span style="font-size: small; font-family: Times New Roman;">Read</span></strong></td>
</tr>
<tr style="height: 15.75pt;" height="21">
<td class="xl24" style="border: medium none #d4d0c8; height: 15.75pt; background-color: transparent;" height="21"><span style="font-size: small; font-family: Times New Roman;">Memcached</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">55,989 </span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">50,974 </span></td>
</tr>
<tr style="height: 15.75pt;" height="21">
<td class="xl24" style="border: medium none #d4d0c8; height: 15.75pt; background-color: transparent;" height="21"><span style="font-size: small; font-family: Times New Roman;">Memcachedb</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">25,583 </span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">35,260 </span></td>
</tr>
<tr style="height: 15.75pt;" height="21">
<td class="xl24" style="border: medium none #d4d0c8; height: 15.75pt; background-color: transparent;" height="21"><span style="font-size: small; font-family: Times New Roman;">Tokyo Tyrant</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">42,988 </span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">46,238 </span></td>
</tr>
<tr style="height: 15.75pt;" height="21">
<td class="xl24" style="border: medium none #d4d0c8; height: 15.75pt; background-color: transparent;" height="21"><span style="font-size: small; font-family: Times New Roman;">Redis</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">85,765 </span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">71,708 </span></td>
</tr>
</tbody>
</table>
<p><strong>Server Load Average</strong></p>
<table style="width: 249pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0" width="332">
<colgroup span="1">
<col style="width: 77pt;" span="1" width="102"></col>
<col style="width: 86pt;" span="2" width="115"></col>
</colgroup>
<tbody>
<tr style="height: 15.75pt;" height="21">
<td class="xl25" style="border: medium none #d4d0c8; width: 77pt; height: 15.75pt; background-color: transparent;" width="102" height="21"><span style="font-size: small; font-family: Times New Roman;"><strong>Store</strong></span></td>
<td class="xl25" style="border: medium none #d4d0c8; width: 86pt; background-color: transparent;" width="115"><span style="font-size: small; font-family: Times New Roman;"><strong>Write</strong></span></td>
<td class="xl25" style="border: medium none #d4d0c8; width: 86pt; background-color: transparent;" width="115"><strong><span style="font-size: small; font-family: Times New Roman;">Read</span></strong></td>
</tr>
<tr style="height: 15.75pt;" height="21">
<td class="xl24" style="border: medium none #d4d0c8; height: 15.75pt; background-color: transparent;" height="21"><span style="font-size: small; font-family: Times New Roman;">Memcached</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;"><span style="font-size: small; font-family: Times New Roman;">1.80, 1.53, 0.87</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;"><span style="font-size: small; font-family: Times New Roman;">1.17, 1.16, 0.83</span></td>
</tr>
<tr style="height: 15.75pt;" height="21">
<td class="xl24" style="border: medium none #d4d0c8; height: 15.75pt; background-color: transparent;" height="21"><span style="font-size: small; font-family: Times New Roman;">MemcacheDB</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;"><span style="font-size: small; font-family: Times New Roman;">1.44, 0.93, 0.64</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;"><span style="font-size: small; font-family: Times New Roman;">4.35, 1.94, 1.05</span></td>
</tr>
<tr style="height: 15.75pt;" height="21">
<td class="xl24" style="border: medium none #d4d0c8; height: 15.75pt; background-color: transparent;" height="21"><span style="font-size: small; font-family: Times New Roman;">Tokyo Tyrant</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;"><span style="font-size: small; font-family: Times New Roman;">3.70, 1.71, 1.14</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;"><span style="font-size: small; font-family: Times New Roman;">2.98, 1.81, 1.26</span></td>
</tr>
<tr style="height: 15.75pt;" height="21">
<td class="xl24" style="border: medium none #d4d0c8; height: 15.75pt; background-color: transparent;" height="21"><span style="font-size: small; font-family: Times New Roman;">Redis</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;"><span style="font-size: small; font-family: Times New Roman;">1.06, 0.32, 0.18</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;"><span style="font-size: small; font-family: Times New Roman;">1.56, 1.00, 0.54</span></td>
</tr>
</tbody>
</table>
<h2>3. Larger data size test result</h2>
<p>Test 2, 1-500,000 as key, 20k bytes string value, do set, then get test, all get test has result.<br />
Request per second(mean)<br />
<strong>(Aug 13 Update: fixed a bug on get() that read non-exist key)</strong><br />
<img class="alignnone size-full wp-image-385" title="key-value-performance-2(update)" src="http://timyang.net/blog/wp-content/uploads/2009/08/key-value-performance-21.png" alt="key-value-performance-2(update)" width="646" height="378" /></p>
<table style="width: 270pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0" width="359">
<colgroup span="1">
<col style="width: 130pt;" span="1" width="173"></col>
<col style="width: 70pt;" span="2" width="93"></col>
</colgroup>
<tbody>
<tr style="height: 15.75pt;" height="21">
<td class="xl25" style="border: medium none #d4d0c8; width: 130pt; height: 15.75pt; background-color: transparent;" width="173" height="21"><span style="font-size: small; font-family: Times New Roman;"><strong>Store</strong></span></td>
<td class="xl25" style="border: medium none #d4d0c8; width: 70pt; background-color: transparent;" width="93"><span style="font-size: small; font-family: Times New Roman;"><strong>Write</strong></span></td>
<td class="xl25" style="border: medium none #d4d0c8; width: 70pt; background-color: transparent;" width="93"><strong><span style="font-size: small; font-family: Times New Roman;">Read</span></strong></td>
</tr>
<tr style="height: 15.75pt;" height="21">
<td class="xl24" style="border: medium none #d4d0c8; height: 15.75pt; background-color: transparent;" height="21"><span style="font-size: small; font-family: Times New Roman;">Memcachedb</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">357 </span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">327 </span></td>
</tr>
<tr style="height: 15.75pt;" height="21">
<td class="xl24" style="border: medium none #d4d0c8; height: 15.75pt; background-color: transparent;" height="21"><span style="font-size: small; font-family: Times New Roman;">Tokyo Tyrant</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">3,501 </span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">257 </span></td>
</tr>
<tr style="height: 15.75pt;" height="21">
<td class="xl24" style="border: medium none #d4d0c8; height: 15.75pt; background-color: transparent;" height="21"><span style="font-size: small; font-family: Times New Roman;">Redis</span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">1,542 </span></td>
<td class="xl26" style="background-color: transparent; border: #d4d0c8;" align="right"><span style="font-size: small; font-family: Times New Roman;">957 </span></td>
</tr>
</tbody>
</table>
<h2>4. Some notes about the test</h2>
<p>When test Redis server, the memory goes up steadily, consumed all 8G and then use swap(and write speed slow down), after all memory and swap space is used, the client will get exceptions. So use Redis in a productive environment should limit to a small data size. It is another cache solution rather than a persistent storage. <strong>So compare Redis together with MemcacheDB/TC may not fair because Redis actually does not save data to disk during the test</strong>.</p>
<p>Tokyo cabinet and memcachedb are very stable during heavy load, use very little memory in set test and less than physical memory in get test.</p>
<p>MemcacheDB peformance is poor for write large data size(20k).</p>
<p>The call response time was not monitored in this test.</p>
Similar Posts:<ul><li><a href="http://timyang.net/programming/thrift-protocol-buffers-performance-2/" rel="bookmark" title="April 17, 2009">Thrift and Protocol Buffers performance in Java Round 2</a></li>

<li><a href="http://timyang.net/programming/thrift-protocol-buffers-performance-java/" rel="bookmark" title="April 2, 2009">Thrift and Protocol Buffers performance in Java</a></li>

<li><a href="http://timyang.net/programming/c-erlang-java-performance/" rel="bookmark" title="November 11, 2009">C, Erlang, Java and Go Web Server performance test</a></li>

<li><a href="http://timyang.net/architecture/friendfeed-like-aggregator/" rel="bookmark" title="April 3, 2009">Ideas for creating a friendfeed like feed aggregator system</a></li>

<li><a href="http://timyang.net/python/python-thread-socket-server/" rel="bookmark" title="March 8, 2009">Python thread socket server</a></li>
</ul><!-- Similar Posts took 20.571 ms -->]]></content:encoded>
			<wfw:commentRss>http://timyang.net/data/mcdb-tt-redis/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
	</channel>
</rss>
