<?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; libmemcached</title>
	<atom:link href="http://torum.net/tag/libmemcached/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>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>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>
	</channel>
</rss>

