<?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; memcached</title>
	<atom:link href="http://torum.net/tag/memcached/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>memcached project gets a facelift!</title>
		<link>http://torum.net/2009/11/memcached-project-gets-a-facelift/</link>
		<comments>http://torum.net/2009/11/memcached-project-gets-a-facelift/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 07:48:36 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[memcached]]></category>

		<guid isPermaLink="false">http://torum.net/?p=2306</guid>
		<description><![CDATA[Thanks to Alan a.k.a Dormando and his designer&#8217;s efforts, the memcached project now has a new look and a domain. From what I&#8217;ve heard, http://danga.com/memcached will soon be pointed at http://memcached.org, which from now on will be the official project domain. Awesome! Dormando and I have talked about internationalizing the project site so that keen [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to Alan a.k.a <a href="http://dormando.livejournal.com/">Dormando</a> and his designer&#8217;s efforts, the memcached project now has a new look and a domain. From what I&#8217;ve heard, <a href="http://danga.com/memcached">http://danga.com/memcached</a> will soon be pointed at <a href="http://danga.com/memcached">http://memcached.org</a>, which from now on will be the official project domain. Awesome!</p>
<p align="center"><a href="http://www.flickr.com/photos/tmaesaka/4084642309/" title="memcached Website Renewal by tmaesaka, on Flickr"><img src="http://farm3.static.flickr.com/2779/4084642309_875e9cc01d.jpg" width="463" height="500" alt="memcached Website Renewal" /></a></p>
<p>Dormando and I have talked about internationalizing the project site so that keen individuals can translate the files and commit it to the git repository. This would give life to <a href="http://danga.com/memcached">http://memcached.jp</a> which I happen to own and eagerly waiting to contribute.</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2009/11/memcached-project-gets-a-facelift/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>memcapable and memcached binary protocol</title>
		<link>http://torum.net/2009/09/memcapable-and-memcached-binary-protocol/</link>
		<comments>http://torum.net/2009/09/memcapable-and-memcached-binary-protocol/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 05:00:40 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[memcached]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[fulltext]]></category>
		<category><![CDATA[groonga]]></category>
		<category><![CDATA[libmemcached]]></category>

		<guid isPermaLink="false">http://torum.net/?p=2292</guid>
		<description><![CDATA[memcapable is a tool that was recently included into the libmemcached package (as of version 0.33). In short, you can use it to verify whether a particular server supports the memcached binary protocol. You can read why such a tool was created in the blog entries published by the guys who came up with it: [...]]]></description>
			<content:encoded><![CDATA[<p>memcapable is a tool that was recently included into the libmemcached package (as of version 0.33). In short, you can use it to verify whether a particular server supports the memcached binary protocol. You can read why such a tool was created in the blog entries published by the guys who came up with it:</p>
<ul>
<li><a href="http://blog.northscale.com/northscale-blog/2009/09/power-in-the-protocol.html">Matt Ingenthron &#8211; power in the protocol</a></li>
<li><a href="http://blogs.sun.com/trond/entry/memcapable">Trond Norbye &#8211; memcapable</a></li>
</ul>
<p>Running memcapable against memcached is not so interesting since it&#8217;s been done by many of us already. Instead, I decided to run it against a full text search engine called <a href="http://groonga.org/">Groonga</a> which apparently supports a subset of the memcached binary protocol.</p>
<p>For those that are interested, Groonga is a successor project to <a href="http://qwik.jp/senna/">Senna</a>, which is a open source embedded fulltext search engine that gained huge success in Japan. Senna is commonly used by embedding it into MySQL but Groonga _can_ run as a standalone server. For more info, here&#8217;s Kaj Arnö&#8217;s <a href="http://blogs.mysql.com/kaj/2008/04/13/senna-tritonn-fast-full-text-search-in-japanese/">past blog entry</a> on Senna.</p>
<h3>Testing Groonga with memcapable</h3>
<p>Running Groonga in foreground:</p>

<div class="wp_syntax"><div class="code"><pre class="null" style="font-family:monospace;">$ groonga -s -p 11211</pre></div></div>

<p>Results obtained from running memcapable on the same host:</p>

<div class="wp_syntax"><div class="code"><pre class="null" style="font-family:monospace;">$ memcapable
noop            [pass]
quit            [pass]
quitq           [pass]
set             [pass]
setq            [FAIL]
flush           [pass]
flushq          [pass]
add             [pass]
addq            [FAIL]
replace         [pass]
replaceq                [FAIL]
delete          [pass]
deleteq         [FAIL]
get             [pass]
getq            [pass]
getk            [pass]
getkq           [pass]
incr            [FAIL]
incrq           [pass]
decr            [FAIL]
decrq           [pass]
version         [pass]
append          [FAIL]
appendq         [FAIL]
prepend         [FAIL]
prependq                [FAIL]
stat            [FAIL]
illegal         [FAIL]
12 of 28 tests failed</pre></div></div>

<p>As you can see above, Groonga doesn&#8217;t support the full binary command stack but it shows how it will be possible to perform full text search from your favorite client library in the future. I&#8217;m saying future because Groonga is still a project in progress.</p>
<p>memcapable is your friend when you need to verify whether your server is communicating properly. I&#8217;m sure there are other projects that take advantage of the binary protocol whether it&#8217;s closed or open. For example, someone <a href="http://twitter.com/yangkang/status/4443958690">pinged me on Twitter</a> that they&#8217;re working on something along this line.</p>
<h3>Mac OS X users will need to wait for libmemcached-0.34</h3>
<p>I found a minor glitch in OS X that would make certain tests fail. Fortunately <a href="https://bugs.launchpad.net/libmemcached/+bug/438157">it was fixed and committed</a> while I was sleeping after I filed the bug. The power of global scale development still surprises me :)</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2009/09/memcapable-and-memcached-binary-protocol/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>memcached Binary Protocol is here for real</title>
		<link>http://torum.net/2009/07/memcached-binary-protocol-is-here-for-real/</link>
		<comments>http://torum.net/2009/07/memcached-binary-protocol-is-here-for-real/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 00:45:47 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[memcached]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://torum.net/?p=2277</guid>
		<description><![CDATA[I&#8217;m playing a little behind but I&#8217;d like to spread the word that memcached-1.4.0 has been released. http://code.google.com/p/memcached/downloads/list http://code.google.com/p/memcached/wiki/ReleaseNotes140 You can also find blog posts by other memcached developers floating around on the internet. This 1.4 release is quite special for me too since the binary protocol is something I&#8217;ve been eager to see out [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m playing a little behind but I&#8217;d like to spread the word that memcached-1.4.0 has been released. </p>
<ul>
<li><a href="http://code.google.com/p/memcached/downloads/list">http://code.google.com/p/memcached/downloads/list</a></li>
<li><a href="http://code.google.com/p/memcached/wiki/ReleaseNotes140">http://code.google.com/p/memcached/wiki/ReleaseNotes140</a></li>
</ul>
<p>You can also find <a href="http://blogsearch.google.com/blogsearch?ie=UTF-8&#038;q=memcached+1.4">blog posts</a> by other memcached developers floating around on the internet. This 1.4 release is quite special for me too since the binary protocol is something I&#8217;ve been eager to see out in the open for sometime now. I remember printing out the early binary protocol specification (the draft that was made before I joined the community) and reading it on the flight to SFO back in 2007.</p>
<p>Much has happened since then with many input from both developers and non-developers. Several commercial organizations from small to large has helped us evaluate the old experimental branch(es) that we&#8217;ve been working on at <a href="http://github.com/dustin/memcached/tree/master">github</a>. The 1.4 release is a result of community effort that I&#8217;m really proud to be part of.</p>
<p>I recommend all of you to update to 1.4 and also take a look at the latest version of your client library. See if it supports the binary protocol. If it doesn&#8217;t, you should bug the author about it ;)</p>
<p>Which reminds me, I need to ping <a href="http://dormando.livejournal.com/">Dormando</a> and <a href="http://hachi.vox.com/">Hachi</a> about the binary protocol patch that I wrote for <a href="http://search.cpan.org/~bradfitz/Cache-Memcached-1.26/lib/Cache/Memcached.pm">Cache::Memcached</a> last year&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2009/07/memcached-binary-protocol-is-here-for-real/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Seminar on memcached 1.3</title>
		<link>http://torum.net/2009/04/memcached-webinar/</link>
		<comments>http://torum.net/2009/04/memcached-webinar/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 21:49:31 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[event]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[seminar]]></category>

		<guid isPermaLink="false">http://torum.net/?p=1448</guid>
		<description><![CDATA[As I&#8217;ve been tweeting the last couple of weeks, I&#8217;m going to do a web seminar on the next series of memcached (1.3) that is currently under beta release. I&#8217;m afraid there won&#8217;t be enough time to cover all the nuts and bolts but I will cover most of the great thoughts and engineering that [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve been <a href="http://twitter.com/tmaesaka">tweeting</a> the last couple of weeks, I&#8217;m going to do a web seminar on the next series of memcached (1.3) that is currently under <a href="http://code.google.com/p/memcached/downloads/list">beta release</a>. I&#8217;m afraid there won&#8217;t be enough time to cover all the nuts and bolts but I will cover most of the great thoughts and engineering that went into the source tree by <strong>the community</strong>.</p>
<ul>
<li><a href="http://www.mysql.com/news-and-events/web-seminars/display-323.html">http://www.mysql.com/news-and-events/web-seminars/display-323.html</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/tmaesaka/3487276698/" title="For Blog by tmaesaka, on Flickr"><img src="http://farm4.static.flickr.com/3395/3487276698_805bd09a85_o.jpg" width="440" height="315" alt="For Blog" /></a></p>
<p>Thank you for the opportunity <a href="http://www.mysql.com">Sun/MySQL</a> and I&#8217;ll hopefully see you all there!</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2009/04/memcached-webinar/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cluster analysis with libmemcached</title>
		<link>http://torum.net/2009/01/cluster-analysis-libmemcached/</link>
		<comments>http://torum.net/2009/01/cluster-analysis-libmemcached/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 18:57:13 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[memcached]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[libmemcached]]></category>

		<guid isPermaLink="false">http://torum.net/?p=692</guid>
		<description><![CDATA[Something I&#8217;ve been wanting to add to libmemcached for a while is a cluster analysis feature that can be used to calculate useful information for system admins that deploy multiple memcached nodes. Many webshops already do this by writing their own so it makes sense to have this functionality in a community driven library. This [...]]]></description>
			<content:encoded><![CDATA[<p>Something I&#8217;ve been wanting to add to <a href="http://tangent.org/552/libmemcached.html">libmemcached</a> for a while is a cluster analysis feature that can be used to calculate useful information for system admins that deploy multiple memcached nodes. Many webshops already do this by writing their own so it makes sense to have this functionality in a community driven library. This means people can pitch in their useful stats calculation which results in benefiting everyone.</p>
<p>So, with that in mind I wrote a patch that contains the initial codebase for the analyzer which is now  reviewed and <a href="http://hg.tangent.org/libmemcached/rev/80d7781bf09f">merged into trunk</a>. This also gave me a reason to claim the commit access that Brian has been offering me for nearly a year&#8230; (I know, I&#8217;m lazy and useless).</p>
<p>At the moment, you can get the following information with the new memcached_analyze(3) function:</p>
<ul>
<li>Average item size in the pool</li>
<li>Node that is eating the most memory</li>
<li>Node with least designated memory remaining</li>
<li>Node with the longest uptime</li>
<li>Pool-wide Hit Ratio</li>
</ul>
<p>I know, there isn&#8217;t much at the moment but more will be added in upcoming pushes. The analyzer is pretty easy to extend so please feel free to throw patches for it! Or, you could pitch in by <a href="http://lists.tangent.org/mailman/listinfo/libmemcached">telling us</a>  useful figures that should be computed.</p>
<p>Hopefully this new feature will be released next month :)</p>
<h3>Avoid the library by using memstat</h3>
<p>The memstat tool (distributed with libmemcached) has been enhanced with the new &#8216;&#8211;analyze&#8217; option that will use the analyzer and give you a human readable output. You should use memstat unless you need to explicitly use the values returned by the analyzer.</p>
<p>Using it is easy, all you need to do is specify the servers that you&#8217;d like to inspect and give it the &#8216;&#8211;analyze&#8217; option like this (only two servers for demo purpose):</p>

<div class="wp_syntax"><div class="code"><pre class="null" style="font-family:monospace;">$ memstat --servers=localhost:11211,localhost:11311 --analyze
Memcached Cluster Analysis Report
&nbsp;
    Number of Servers Analyzed         : 2
    Average Item Size (incl/overhead)  : 54 bytes
&nbsp;
    Node with most memory consumption  : localhost:11211 (54 bytes)
    Node with least free space         : localhost:11211 (67108810 bytes remaining)
    Node with longest uptime           : localhost:11311 (780s)
    Pool-wide Hit Ratio                : 100%</pre></div></div>

<p>Easy!</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2009/01/cluster-analysis-libmemcached/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google App Engine and it&#8217;s Memcache API</title>
		<link>http://torum.net/2008/11/gae-memcache-api/</link>
		<comments>http://torum.net/2008/11/gae-memcache-api/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 20:31:40 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[memcached]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://torum.net/?p=676</guid>
		<description><![CDATA[Google App Engine (GAE) is something I&#8217;ve been meaning to look into for personal interest but have been failing to do up until now due to lazyness and being relatively busy. So specifically, I&#8217;m interested in the Datastore API and the Memcache API since well, thats what I do. For those that aren&#8217;t familiar with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/appengine/">Google App Engine</a> (GAE) is something I&#8217;ve been meaning to look into for personal interest but have been failing to do up until now due to lazyness and being relatively busy.</p>
<p>So specifically, I&#8217;m interested in the <a href="http://code.google.com/appengine/docs/datastore/">Datastore API</a> and the <a href="http://code.google.com/appengine/docs/memcache/">Memcache API</a> since well, thats what I do. For those that aren&#8217;t familiar with GAE, it is a platform provided by Google that allows you to run your web application on their infrastructure. Using the Google infrastructure is done through a set of <a href="http://code.google.com/appengine/docs/">provided APIs</a> and they take care of Scaling and <a href="http://en.wikipedia.org/wiki/High_availability">HA</a> issues for you. This means you don&#8217;t have to invest into hardware (elastic running cost) nor have to repair anything (other than your code of course). So, its a typical example of <a href="http://en.wikipedia.org/wiki/Platform_as_a_service">PaaS</a>.</p>
<h3>Taking a look at the Memcache API</h3>
<p>Nowadays its gradually becoming common knowledge in the web industry that using <a href="http://www.danga.com/memcached">memcached</a> can help your site scale and reduce the response time dramatically in a cost-efficient fashion (adding a DB Slave vs memcached node). The question is, what&#8217;s behind Google&#8217;s Memcache API? On the App Engine documentation, it is only stated that:</p>
<blockquote><p>The Memcache API has similar features to and is compatible with memcached by Danga Interactive.</p></blockquote>
<p>So, its actuallly not stated that the backend is powered by memcached despite the name. This means that the backend can be anything like a distributed <a href="http://code.google.com/p/google-sparsehash/">Google Sparse Hash</a> over the wire. I guess what&#8217;s important is not so much the cache daemon but by keeping the interface consistent with memcached, developers that are familiar with memcached can use GAE without allergic reactions. Not to mention, memcached has a brilliant interface for a distributed cache.</p>
<p>Caching your data on GAE is uver simple. You first import the &#8216;memcache&#8217; module from the GAE package:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> google.<span style="color: black;">appengine</span>.<span style="color: black;">api</span> <span style="color: #ff7700;font-weight:bold;">import</span> memcache</pre></div></div>

<p>then call the appropriate <a href="http://code.google.com/appengine/docs/memcache/clientclass.html">API method</a> for whatever it is that you want to do.</p>
<p>Just for fun I tried setting a value using a key thats longer than 250 bytes since the maximum length of a key that memcached will accept over the <a href="http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt">ASCII protocol</a> is 250 bytes (aka 250 ASCII characters). So how about the App Engine?</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> google.<span style="color: black;">appengine</span>.<span style="color: black;">api</span> <span style="color: #ff7700;font-weight:bold;">import</span> memcache
&nbsp;
memcache.<span style="color: black;">flush_all</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
test_key = <span style="color: #483d8b;">'x'</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">300</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> memcache.<span style="color: #008000;">set</span><span style="color: black;">&#40;</span>test_key, <span style="color: #483d8b;">'some_val'</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Failed to set'</span>
    quit<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Looks like we're good = &quot;</span> + memcache.<span style="color: black;">get</span><span style="color: black;">&#40;</span>test_key<span style="color: black;">&#41;</span></pre></div></div>

<p>Well, turns out this code didn&#8217;t run with this error message from my local app server:</p>
<blockquote><p><strong><type 'exceptions.ValueError'>Keys may not be more than 250 bytes in length, received 300 bytes</strong>
</p></blockquote>
<p>Hehe, this looks very memcached to me but who knows, this could also be deliberate to keep things consistent with memcached.</p>
<h3>Memcache API and Datastore API in Action</h3>
<p>Okay, so to see if the Memcache API + Datastore API performs just like what you would expect from memcached + MySQL, I wrote a simple GAE Web Application. Here is <a href="http://torum.net/dist/data_api_example.tar.gz">the sourcecode</a> and screenshots of the application actually running on Google:</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/tmaesaka/3045435635/" title="gae_memcache_api by tmaesaka, on Flickr"><img src="http://farm4.static.flickr.com/3159/3045435635_8f71466620_m.jpg" width="240" height="142" alt="gae_memcache_api" /></a> <a href="http://www.flickr.com/photos/tmaesaka/3046270024/" title="gae_datastore_api by tmaesaka, on Flickr"><img src="http://farm4.static.flickr.com/3204/3046270024_d39f1058a3_m.jpg" width="240" height="141" alt="gae_datastore_api" /></a></p>
<p>All it does is, it populates your Cache and Persistent Storage with 64 rows that are 4KB each (so, 256KB in total) and measures how long it takes to bring it over to the application layer. This is obviously not enough to simulate data transfer in a real world web application but I figured its enough to make a point.</p>
<p>So as expected, retrieving data is faster by using the memcache API and in theory this performance should not  degrade and run constantly even with increased concurrent connections and requests. On the other hand, performance of the Datastore API _could_ degrade. I&#8217;m saying &#8220;could&#8221; because as much as I&#8217;d like to prove this point, I didn&#8217;t really want to <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">ab</a> Google.</p>
<p>Btw, after quickly looking at the caching code in the SDK, it seems Memcache is emulated using <a href="http://www.python.org/doc/2.5.2/tut/node7.html">Python&#8217;s Dictionary</a> on the local development environment.</p>
<h3>Taking a look into Cached Bytes</h3>
<p>Conveniently, the Memcache API provides a simple way to fetch the amount of bytes that is currently being cached for you:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> google.<span style="color: black;">appengine</span>.<span style="color: black;">api</span> <span style="color: #ff7700;font-weight:bold;">import</span> memcache
&nbsp;
stats = memcache.<span style="color: black;">get_stats</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> stats: <span style="color: #ff7700;font-weight:bold;">print</span> stats<span style="color: black;">&#91;</span><span style="color: #483d8b;">'bytes'</span><span style="color: black;">&#93;</span></pre></div></div>

<p>Being a curious individual and a great stalker, I decided to use this information to compare whatever it is thats behind the Memcache API with memcached. You see, with memcached you don&#8217;t get the exact number of key/value bytes that you sent over the wire because memcached reports the total number of bytes it had consumed, including overheads per item (as it should). In other words, what memcached reports is &#8220;unique&#8221;.</p>
<p>So, below is what I got from comparing the Memcache API (on Google&#8217;s infrastructure) and the latest release of memcached (1.2.6) at the point of this blog entry:</p>
<div style="margin-left: 30px;">
<strong>1 x 128 byte value with a 5 byte key</strong><br />
Memcache API: 133 bytes<br />
memcached-1.2.6: 184 bytes</p>
<p><strong>64 x 128 byte values with 5 byte keys</strong><br />
Memcache API: 8512 bytes<br />
memcached-1.2.6: 11776 bytes</p>
<p><strong>128 x 128 byte values with 5 byte keys</strong><br />
Memcache API: 17024 bytes<br />
memcached-1.2.6: 23552 bytes
</div>
<p>Wow, according to the above results, Google&#8217;s Memcache backend is not showing any overhead in its report. Maybe it is a sparse map over the wire after all. But like I mentioned earlier, it doesn&#8217;t really matter what&#8217;s behind the API because what&#8217;s actually important is that its easy for us end-users to use and that it performs in an O(1) manner.</p>
<h3>Conclusion</h3>
<p>The Google App Engine Documentation rocks! like <a href="http://twitter.com/tmaesaka/status/1008943172">I mentioned on Twitter</a>, the team that worked on the documentation should get a medal. It got me started in no time and gave me just enough information to start doing my own thing without getting frustrated from excessive information.</p>
<p>There are still unresolved questions like how sharding works for the Memcache API. I mean, do each application get a dedicated server instance(s) or are keys appended/prepended with an app_id in the background? The latter approach sounds simple and effective but it opens up another question of stats management. I guess a housekeeping index for each application would get around this issue but there is no programmable way from the outside to confirm this.</p>
<p>On a different note, I should stop being a stalker and just enjoy what&#8217;s been provided (though this is a really difficult thing to do once you dive into the world of engineering) :)</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2008/11/gae-memcache-api/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>memcached Hackathon #5 at Sun Microsystems</title>
		<link>http://torum.net/2008/10/memcached-hackathon-at-sun/</link>
		<comments>http://torum.net/2008/10/memcached-hackathon-at-sun/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 21:06:29 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[memcached]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[hackathon]]></category>

		<guid isPermaLink="false">http://torum.net/?p=525</guid>
		<description><![CDATA[Last week I was in the valley for the fifth memcached Hackathon at Sun Microsystems and visiting some friends at Six Apart HQ. The hackathon was so fun, we ended up leaving at 2am on a weeknight! Thanks to Matt Ingenthron and Sun Microsystems for organizing the event and providing food and space for this [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I was in the valley for the fifth <a href="http://www.socialtext.net/memcached/index.cgi?hackathon">memcached Hackathon</a> at Sun Microsystems and visiting some friends at Six Apart HQ. The hackathon was so fun, we ended up leaving at 2am on a weeknight! Thanks to <a href="http://blogs.sun.com/mingenthron/">Matt Ingenthron</a> and Sun Microsystems for organizing the event and providing food and space for this hackathon :)</p>
<p>In the <a href="http://lists.danga.com/pipermail/memcached/2008-April/006734.html">previous hackathon</a>, we mostly exchanged ideas on the binary protocol and the storage engine interface. This time it was more code oriented and we reviewed and tested the progress everyone had made in the latest binary protocol tree. Unfortunately I couldn&#8217;t cover the whole hackathon but here is a summary of discussions from the <a href="http://www.socialtext.net/memcached/index.cgi?hackathon">agenda</a> that I was involved in:</p>
<h3><strong>Binary Protocol &#8211; Add an engine specific OPCODE </strong></h3>
<p>No disagreements here. An opcode is represented by a 1 byte unsigned integer so the consensus was that we should dedicate anything over 127 (0x7F) for special operations.</p>
<h3><strong>Storage Interface</strong></h3>
<p>We didn&#8217;t get around to discussing the interface in depth since getting the binary protocol released has greater priority at the moment. <a href="http://blogs.sun.com/trond/">Trond</a> however showed me some of the interesting work that he has been doing which will hopefully be out in the open soon.</p>
<h3><strong>Test Framework</strong></h3>
<p>The issue here is that tests aren&#8217;t actively been written. Opinions voiced on this issue was that some people aren&#8217;t comfortable with Perl, and thus difficult to understand the current Perl based test system.</p>
<p>Switching to a different test framework in a different language is easy but the problem is that this is a never-ending story. People can easily start demanding other languages that they feel comfortable in (python, java, ruby, lua, &#8230;). We briefly discussed that the ideal model is to be able to add tests written in any language but we didn&#8217;t go into depth on how we would actually achieve this.</p>
<p>Personally, I have nothing against the current test framework (mind you I like Perl) but I think if we were to switch, a solely C based framework is a good move. I am saying this because those that would think about opening up the memcached package and editing it can most likely write C (is this an assertive assumption? heh).</p>
<h3><strong>Client Libraries</strong></h3>
<p>Unfortunately I couldn&#8217;t get around to participating in the client talk but client-side replication work was being done for <a href="http://tangent.org/552/libmemcached.html">libmemcached</a> and I heard from <a href="http://krow.livejournal.com">Brian Aker</a> that there was good progress.</p>
<p><a href="http://search.cpan.org/~hachi/">Jonathan (hachi)</a> reviewed my binary protocol patch for <a href="http://search.cpan.org/search?query=cache%3A%3Amemcached&#038;mode=all">Cache::Memcached</a> and found that some protocol negotiation assumptions I made in the code can be improved. He is also looking at optimizing the code by subclassing the patch (reduces the number of conditional selections, perl method calls and hash lookups).</p>
<h3><strong>Scaling on Highly Threaded Servers</strong></h3>
<p>We didn&#8217;t really discuss this in depth since we were busy reviewing and testing the server code but as far as I know, we talked about how locking can be improved in memcached. Looking into and preparing for this is a good idea since we are entering a massively concurrent age. To the contrary, guys from Facebook mentioned that they were getting sufficient throughput with the current locking scheme which was awesome to hear.</p>
<p>The engine plugin rearchitecture should fit well with this project since we can interchange different versions of the slabber engine with different locking strategies and make them compete to be the next default memcached engine.</p>
<h3><strong>Conclusion</strong></h3>
<p>The hackathon was fun and we got a lot done in terms of finding things to improve on. It was great to catch up with guys that I communicate a lot with online and talk tech in person. It was awesome that <a href="http://brad.livejournal.com">Brad</a> turned up as well. As for code improvements, <a href="http://bleu.west.spy.net/~dustin/">Dustin&#8217;s</a> test code found an issue in the stats subsystem always returning a zero for an opaque value. A little bit of coding looked necessary to get around this problem since an opaque value is held by the connection structure, which the engine does not have access to (it shouldn&#8217;t) but I was bored on my flight back to Tokyo so this problem is now <a href="http://github.com/tmaesaka/memcached/commit/86159eb7b5c611d25a33eb1cb6c750c806350912">fixed and pushed</a> to my tree :)</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2008/10/memcached-hackathon-at-sun/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>
		<item>
		<title>Why Stats was refactored in memcached-1.3</title>
		<link>http://torum.net/2008/09/memcached-stats-refactor/</link>
		<comments>http://torum.net/2008/09/memcached-stats-refactor/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 09:43:49 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[memcached]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://torum.net/?p=68</guid>
		<description><![CDATA[For those that do not follow the active development of memcached, the current excitement in the community is the new binary protocol that will be introduced in the upcoming 1.3 series. If you&#8217;d like a quick and easy introduction on the binary protocol, you can see the slides from my presentation. So, with such significant [...]]]></description>
			<content:encoded><![CDATA[<p>For those that do not follow the active development of memcached, the current excitement in the community is the new binary protocol that will be introduced in the upcoming 1.3 series. If you&#8217;d like a quick and easy introduction on the binary protocol, you can see the <a href="http://www.slideshare.net/tmaesaka/memcached-binary-protocol-in-a-nutshell-presentation/">slides from my presentation</a>.</p>
<p>So, with such significant advances, the 1.3 codebase is obviously going to look a bit different to the 1.2 codebase, but even then the overall software architecture is the same. Whats significantly different however, is how the stats opreration is implemented. This is why I am writing this entry, to answer the questions that people might have in advance.</p>
<h3><strong>Background in a nutshell</strong></h3>
<p>Looking further ahead, beyond the binary protocol, the memcached community is aiming to achieve a pluggable engine architecture, which will allow memcached to satisfy unique requirements that people might have. These unique requirements can be things like, persistent storage, data dumping, server-side replication and etc. All these fancy stuff obviously goes against the original motives of memcached but I will save this discussion for another day, as it is not appropriate for this entry :)</p>
<p>Supporting third party engines mean that memcached must be able to send back <strong>engine specific</strong> stats to the client (most likely a system admin). To achieve this, memcached&#8217;s stats handling had to be made flexible by splitting the concept of &#8220;stats&#8221; into two segments, &#8220;core server stats&#8221; and &#8220;engine stats&#8221; and hence the refactoring.</p>
<h3><strong>The new approach</strong></h3>
<p>Previously, stats was done by incrementing/accumulating values inside the stats structure (defined in memcached.h). The actual increments were done mostly in the server code.</p>
<p>In the new approach, an engine does not have to depend on the stats structure because this would limit the engine to this structure. Adding an opaque pointer to the structure for pointing to something engine specific could get around this problem but lets not go there&#8230; no, no, no.</p>
<p>All non-server stats are pushed out to the slabber code since this is the closest thing to an engine in memcached at the moment. In this model, if a client asks for something unique (e.g. &#8220;stats malloc&#8221;), then the server will query the engine for &#8220;malloc&#8221;. If the engine has no clue of what the client is asking for, then the server will simply return an error.</p>
<p>Likewise, if the client asks for non-specific stats (&#8220;stats\r\n&#8221; in the ASCII protocol), memcached will return the merged result of itself (core-server stats) and stats for general purpose from the slabber (bytes written, num of get/set and etc).</p>
<p>If you&#8217;d like to see the actual code, take a look at this branch:<br />
<a href="http://github.com/tmaesaka/memcached/commits/binprot" target="_blank">http://github.com/tmaesaka/memcached/commits/binprot</a></p>
<p>Make sure you checkout the &#8220;binprot&#8221; branch.</p>
<h3><strong>Binary Stats is Packet-Per-Stat</strong></h3>
<p>Before I talk about how stats is implemented, I must mention that with the binary protocol, each statistical information is returned in it&#8217;s own packet (as mentioned in the documentation). The key contains the name of the statistical information and the value contains the associated value. Transmission termination is signaled with a packet with no key and value.</p>
<h3><strong>How it works</strong></h3>
<p>So how does this work? the laziest solution is to enforce the responsibility and implementation of data formatting/serialization to the engine, but this has the potential pitfall of:</p>
<ul>
<li>Server Failure due to incorrect formatting/serialization by the engine.</li>
</ul>
<p>Instead, an engine is given a callback that it can use to format/serialize stats data for returning to the core server. This way we can reduce the likelihood of an engine returning something invalid to the core server (assuming that the implementer uses the callback of course). Specifically, the engine needs to implement the following function:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">char</span> <span style="color: #339933;">*</span>get_stats<span style="color: #009900;">&#40;</span><span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>stat_name<span style="color: #339933;">,</span> uint32_t <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>add_stats<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>
                <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>buf<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>key<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> uint16_t klen<span style="color: #339933;">,</span>
                <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>val<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> uint32_t vlen<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #993333;">int</span> <span style="color: #339933;">*</span>buflen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>and notice the callback:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">uint32_t <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>add_stats<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> <span style="color: #339933;">*</span>buf<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>key<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> uint16_t klen<span style="color: #339933;">,</span>
                      <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>val<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> uint32_t vlen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>where the buf argument is the buffer that the entry will be serialized to, the key argument should be the name of the statistical information (e.g. &#8220;bytes&#8221;) and the value should contain the associated value (e.g. &#8220;1024&#8243;). The remaining klen and vlen arguments should represent the length of the key and value (e.g. strlen(&#8220;bytes&#8221;)).</p>
<p>This callback returns the number of bytes it had appended to the provided buffer, which the engine can use to forward the write pointer for further appending. Just make sure you allocate enough memory in advance (each append has a 24 byte overhead for the binary protocol).</p>
<p>Another thing to mention is that the engine does not have to worry whether the return data is for the  ascii or binary protocol, since memcached will give the appropriate callback (with different logic that corresponds to the protocol type) to the engine.</p>
<p>Once the engine populates the buffer with data that it would like to report, it can then simply return it to the core server, where it will be sent back to the client.</p>
<p>So, get_stats() could look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* assume, foo_key = &quot;hello&quot; and foo_val = &quot;world&quot; */</span>
<span style="color: #993333;">char</span> <span style="color: #339933;">*</span>buf<span style="color: #339933;">,</span> <span style="color: #339933;">*</span>ptr<span style="color: #339933;">;</span>
uint32_t nbytes <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>buf <span style="color: #339933;">=</span> malloc<span style="color: #009900;">&#40;</span>num_of_bytes<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> NULL<span style="color: #009900;">&#41;</span>
    <span style="color: #b1b100;">return</span> NULL<span style="color: #339933;">;</span>
&nbsp;
ptr <span style="color: #339933;">=</span> buf<span style="color: #339933;">;</span>
nbytes <span style="color: #339933;">=</span> add_stats<span style="color: #009900;">&#40;</span>ptr<span style="color: #339933;">,</span> foo_key<span style="color: #339933;">,</span> strlen<span style="color: #009900;">&#40;</span>foo_key<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                   foo_val<span style="color: #339933;">,</span> strlen<span style="color: #009900;">&#40;</span>foo_val<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>nbytes<span style="color: #009900;">&#41;</span>
    <span style="color: #b1b100;">return</span> NULL<span style="color: #339933;">;</span>
ptr <span style="color: #339933;">+=</span> nbytes<span style="color: #339933;">;</span>
<span style="color: #339933;">*</span>buflen <span style="color: #339933;">+=</span> nbytes<span style="color: #339933;">;</span>
&nbsp;
...
&nbsp;
<span style="color: #339933;">*</span>buflen <span style="color: #339933;">+=</span> add_stats<span style="color: #009900;">&#40;</span>ptr<span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/* seal with terminator */</span>
<span style="color: #b1b100;">return</span> buf<span style="color: #339933;">;</span></pre></div></div>

<p>Thats it! minimal coding is required from the engine implementer.</p>
<h3><strong>Good and the not so Good</strong></h3>
<p>Like all things, stats over the binary protocol has its ups and downs. The good thing about the packet-per-row approach is that the client library should be easier to write, especially for languages that aren&#8217;t so string friendly (e.g. C compared to Perl). I&#8217;ve already heard that it made libmemcached&#8217;s life happier.</p>
<p>The downside however is the network cost of binary stats compared to the ASCII protocol. Because a packet must be created for each statistical information, the total bytes to transmit over the wire can be relatively large. For example, if you want to return ten stat rows back to the client, then the number of bytes to transmit is:</p>
<p style="text-align: center;"><strong>&#8220;264 bytes (sum of packet headers, including terminator) + size of each key and value&#8221;</strong></p>
<p>whereas with the ASCII protocol it would be just:</p>
<p style="text-align: center;"><strong>&#8220;size of each key/value + 20 bytes (sum of CRLF) + 5 bytes (terminator)&#8221;<br />
</strong></p>
<p>Sure, the size difference may look trivial and you may not issue the stats command much but some system admins might care&#8230;</p>
<h3><strong>Conclusion</strong></h3>
<p>As you can see, a decent amount of thought has been put into the 1.3 series by the memcached community, and as a result, memcached will keep getting better. It will stay simple as it always were and at the same time it will hopefully be able to do new things by accepting external engines in the future.</p>
<p>The stats code refactoring is a small (but important) step towards this goal :)</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2008/09/memcached-stats-refactor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>memcached Night #1 in Tokyo</title>
		<link>http://torum.net/2008/09/memcached-night-tokyo/</link>
		<comments>http://torum.net/2008/09/memcached-night-tokyo/#comments</comments>
		<pubDate>Sun, 21 Sep 2008 06:31:37 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[japanese]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://torum.net/?p=84</guid>
		<description><![CDATA[memcached Night #1 in Tokyoで私が使用した講演資料を公開しました。 memcached Binary Protocol in a Nutshell  View SlideShare presentation or Upload your own. (tags: protocol cache) 最近になって開発が一段落したという事もあり、講演時にベンチマークを取っておらず、説得力に欠けたスライドがいくつかあったかと思います。後付けになってしまいましたが、簡単なベンチマークを講演資料に追加しました。私の結果を要約すると、リクエストのconcurrencyが少ない場面だと、プロトコル間のパフォーマンスに差は見られませんが、同時リクエスト数を増やしていくと、パフォーマンスの差が見えてくるといったところです。今後はもっとヘビーなワークロードでテストを行う必要がありそうですね。 イベント自体は他のスピーカーの方達の話も面白く、ゲーム業界でもmemcachedが大事なところで使われているなど、本当に勉強になりました。参加者の皆さま、あらためて有り難うございます。懇親会も楽しく、COOKPADさんがあれだけのサービスを少数精鋭で支えている（技術面で）という話が私の中で印象強かったです。ぜひまたやりましょう。 最後に二つほど、明らかにさせておきたい事がありましたので、この機会に書かせて頂きます。 プロトコルドキュメントに関して MIRACLE LINUXの吉岡さんのブログエントリーに固定長ヘッダのサイズが16バイトと書かれていて、それはおかしいぞ？と思い、見てみたらSix Apartのsvnレポジトリに入っているドキュメントが古いという事に気がつきました。現時点の仕様では固定長ヘッダのサイズは24バイトで、Trond Norbyeのgitレポジトリに現時点で最新のドキュメントがあります（紛らわしくて、すみません）。 チェックアウトするブランチ 講演以来、様々な方達にバイナリプロトコルのソースツリーを試して頂けているのですが、masterではなく、binprotというブランチ（http://github.com/tmaesaka/memcached/tree/binprot）をチェックアウトしてください。 さて来月、memcached hackathonの参加に米国に行きますので、その際にmemcached Nightで皆さまから頂いたフィードバックや日本での普及活動を口頭で伝えてきますね。]]></description>
			<content:encoded><![CDATA[<p><a href="http://groups.google.com/group/memcached-ja/web/memcached-night-in-tokyo-1" target="_blank">memcached Night #1 in Tokyo</a>で私が使用した講演資料を公開しました。</p>
<div style="padding-left: 98px; margin: 22px 0 22px;">
<div id="__ss_608808" style="width: 475px; text-align: left;"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="memcached Binary Protocol in a Nutshell" href="http://www.slideshare.net/tmaesaka/memcached-binary-protocol-in-a-nutshell-presentation?type=powerpoint">memcached Binary Protocol in a Nutshell</a><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="475" height="390" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=memcachednighttokyo-1221916987381523-9&amp;rel=0&amp;stripped_title=memcached-binary-protocol-in-a-nutshell-presentation" /><embed type="application/x-shockwave-flash" width="475" height="390" src="http://static.slideshare.net/swf/ssplayer2.swf?doc=memcachednighttokyo-1221916987381523-9&amp;rel=0&amp;stripped_title=memcached-binary-protocol-in-a-nutshell-presentation" allowscriptaccess="always" allowfullscreen="true"></embed></object> </p>
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View SlideShare <a style="text-decoration:underline;" title="View memcached Binary Protocol in a Nutshell on SlideShare" href="http://www.slideshare.net/tmaesaka/memcached-binary-protocol-in-a-nutshell-presentation?type=powerpoint">presentation</a> or <a style="text-decoration:underline;" href="http://www.slideshare.net/upload?type=powerpoint">Upload</a> your own. (tags: <a style="text-decoration:underline;" href="http://slideshare.net/tag/protocol">protocol</a> <a style="text-decoration:underline;" href="http://slideshare.net/tag/cache">cache</a>)</div>
</div>
</div>
<p>最近になって開発が一段落したという事もあり、講演時にベンチマークを取っておらず、説得力に欠けたスライドがいくつかあったかと思います。後付けになってしまいましたが、簡単なベンチマークを講演資料に追加しました。私の結果を要約すると、リクエストのconcurrencyが少ない場面だと、プロトコル間のパフォーマンスに差は見られませんが、同時リクエスト数を増やしていくと、パフォーマンスの差が見えてくるといったところです。今後はもっとヘビーなワークロードでテストを行う必要がありそうですね。</p>
<p>イベント自体は他のスピーカーの方達の話も面白く、ゲーム業界でもmemcachedが大事なところで使われているなど、本当に勉強になりました。参加者の皆さま、あらためて有り難うございます。懇親会も楽しく、<a href="http://cookpad.com/" target="_blank">COOKPAD</a>さんがあれだけのサービスを少数精鋭で支えている（技術面で）という話が私の中で印象強かったです。ぜひまたやりましょう。</p>
<p>最後に二つほど、明らかにさせておきたい事がありましたので、この機会に書かせて頂きます。</p>
<h3><strong>プロトコルドキュメントに関して</strong></h3>
<p>MIRACLE LINUXの<a href="http://blog.miraclelinux.com/yume/2008/09/memcached-night.html" target="_blank">吉岡さんのブログエントリー</a>に固定長ヘッダのサイズが16バイトと書かれていて、それはおかしいぞ？と思い、見てみたらSix Apartのsvnレポジトリに入っているドキュメントが古いという事に気がつきました。現時点の仕様では固定長ヘッダのサイズは24バイトで、Trond Norbyeのgitレポジトリに<a href="http://github.com/trondn/memcached/tree/binprot/doc/protocol-binary.txt" target="_blank">現時点で最新のドキュメント</a>があります（紛らわしくて、すみません）。</p>
<h3><strong>チェックアウトするブランチ</strong></h3>
<p>講演以来、様々な方達にバイナリプロトコルのソースツリーを試して頂けているのですが、masterではなく、binprotというブランチ（<a href="http://github.com/tmaesaka/memcached/tree/binprot" target="_blank">http://github.com/tmaesaka/memcached/tree/binprot</a>）をチェックアウトしてください。</p>
<p>さて来月、<a href="http://www.socialtext.net/memcached/index.cgi?hackathon" target="_blank">memcached hackathon</a>の参加に米国に行きますので、その際にmemcached Nightで皆さまから頂いたフィードバックや日本での普及活動を口頭で伝えてきますね。</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2008/09/memcached-night-tokyo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

