<?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>Netuality &#187; memcache</title>
	<atom:link href="http://www.netuality.ro/tag/memcache/feed" rel="self" type="application/rss+xml" />
	<link>http://www.netuality.ro</link>
	<description>Taming the big, bad, nasty websites</description>
	<lastBuildDate>Mon, 07 Nov 2011 16:36:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>memcached vs tugela vs memcachedb</title>
		<link>http://www.netuality.ro/memcached-vs-tugela-vs-memcachedb/presentations/20080317</link>
		<comments>http://www.netuality.ro/memcached-vs-tugela-vs-memcachedb/presentations/20080317#comments</comments>
		<pubDate>Sun, 16 Mar 2008 21:38:38 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[memcachedb]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[tugela]]></category>
		<category><![CDATA[wurbe]]></category>

		<guid isPermaLink="false">http://www.netuality.ro/memcached-vs-tugela-vs-memcachedb/presentations/20080317</guid>
		<description><![CDATA[This presentation was planned for an older Wurbe event, but as this never quite happened in the last 4 months I am publishing it now, before it becomes totally obsolete. My original contribution here is a comparison between the original memcached server from Danga and the tugela fork from the MediaWiki programmers. I&#8217;ve also tried [...]]]></description>
			<content:encoded><![CDATA[<p>This presentation was planned for an older <a href="http://wurbe.ro/" target="_blank">Wurbe</a> event, but as this never quite happened in the last 4 months I am publishing it now, before it becomes totally obsolete.</p>
<p><center><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=memcached-vs-tugela-1205702329685207-3"/><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=memcached-vs-tugela-1205702329685207-3" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></center></p>
<p>My original contribution here is a comparison between the <a href="http://www.danga.com/memcached/" target="_blank">original memcached serve</a>r from Danga and the <a href="http://meta.wikimedia.org/wiki/Tugela_Cache" target="_blank">tugela fork</a> from the MediaWiki programmers. I&#8217;ve also tried <a href="http://memcachedb.org/" target="_blank">memcachedb</a> but the pre 1.0 version (from Google Code) in November 2007 was quite unstable and unpredictible.</p>
<p>In a nutshell, these memcache versions are using <a href="http://www.oracle.com/technology/products/berkeley-db/index.html" target="_blank">BerkeleyDB</a> instead of memory slab allocator. There are 2 direct consequences:</p>
<ul>
<li>when the memory is large enough for the whole cache, database-backed servers will be slower (my tests shown 10-15% which might be tolerable &#8211; or not &#8211; for your app)</li>
<li>when you&#8217;ve got lots of data to cache and your server&#8217;s memory is low, relying on bdb is significantly better than letting the swap mechanism to do its job (from my benchmarks, the difference can go up to 10 times faster especially under very high concurrency conditions)</li>
</ul>
<p>Tugela will prove especially useful when running it on virtualized servers with very low memory.</p>
<p>My tests were performed with the &#8220;Tummy&#8221; Python client and Stackless for the multithreaded version. In one of the following weeks I&#8217;ll update the benchmarks for memcachedb 1.0.x &#8211; and I promise never ever to wait 4 months for a presentation, again &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/memcached-vs-tugela-vs-memcachedb/presentations/20080317/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Monitoring memcached with cacti</title>
		<link>http://www.netuality.ro/monitoring-memcached-with-cacti/tools/20060802</link>
		<comments>http://www.netuality.ro/monitoring-memcached-with-cacti/tools/20060802#comments</comments>
		<pubDate>Wed, 02 Aug 2006 19:54:44 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/monitoring-memcached-with-cacti/uncategorized/20060802</guid>
		<description><![CDATA[Memcached is a clusterable cache server from Danga. Or, as they call, it a distributed memory object caching system. Well, whatever. Just note that memcached clients exist for lots of languages (Java, PHP, Python, Ruby, Perl) &#8211; mainstream languages in the web world. A lighter version of server was rewritten in Java by Mr. Jehiah [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.danga.com/memcached/" target="_new">Memcached</a> is a clusterable cache server from <a href="http://www.danga.com/" target="_new">Danga</a>. Or, as they call, it a <strong>distributed memory object caching system</strong>. Well, whatever. Just note that memcached clients exist for lots of languages (Java, PHP, Python, Ruby, Perl) &#8211; mainstream languages in the web world. A lighter version of server was <a href="http://jehiah.com/projects/j-memcached/" target="_new">rewritten in Java</a> by Mr. Jehiah Czebotar. Major websites such as Facebook, Slashdot, Livejournal and Dealnews use memcached in order to scale for the huge load they&#8217;re serving.  Recently, we needed to monitor the memcache servers on a high-performance web cluster serving the <a href="http://www.planigo.com/en/index.html" target="_blank">Planigo</a> websites. By googling and reading the related newsgroups, I was able to find two solutions:</p>
<ul>
<li>from faemalia.net, a script which is integrated with the <a href="http://www.faemalia.net/mysqlUtils/" target="_new">MySQL server templates</a> for Cacti. Uses the Perl client.</li>
<li>from dealnews.com, a dedicated memcached template for Cacti and some scripts based on the Python client. The installation is <a href="http://dealnews.com/developers/cacti/memcached.html" target="_new">thoroughly described here</a>.</li>
</ul>
<p>These two solutions have the same approach &#8211; provide a specialized Cacti template. The charts drawn by these templates are based on data extracted by the execution of memcached client scripts. Maybe very elegant, but could become a pain in the dorsal area. Futzing with Cacti templates was never my favorite pasttime. Just try to import a template exported from a different version of Cacti and you&#8217;ll know what I mean.  In my opinion, there is a simple way, which consists in installing a memcached client on all the memcached servers, then extracting the statistical values using a script. We&#8217;ll use the technique described in <a href="http://www.netuality.ro/monitor-everything-on-your-linux-servers-with-snmp-and-cacti/tools/20060305" target="_blank">one of my previous posts</a>, to expose script results as SNMP OID values. Then, track these values in Cacti via the generic existing mechanism. My approach has the disadvantage of installing a memcached client on all the servers. However, it is very simple to build your own charts and data source templates, as for any generic SNMP data.  All you need now a simple script which will print the memcached statistics, one per line. I will provide one-liners for Python, which will obviously work only on machines having Python and the <a href="ftp://ftp.tummy.com/pub/python-memcached/" target="_new">&#8220;tummy&#8221; client</a> installed. This is the recipe (default location of Python executable on Debian is <em>/usr/bin/python</em> but YMMV):</p>
<p>1. first use this one liner as snmpd exec :</p>
<p><em>/usr/bin/python -c &#8220;import memcache; print (&#8216;%s&#8217;%[memcache.Client(['127.0.0.1:11211'], debug=0).get_stats()[0][1],]).replace(\&#8221;&#8216;\&#8221;,&#8221;).replace(&#8216;,&#8217;,'\n&#8217;).replace(&#8216;[','')<br />
.replace(']&#8216;,&#8221;).replace(&#8216;{&#8216;,&#8221;).replace(&#8216;}&#8217;,&#8221;)&#8221;</em></p>
<p>This will display the name of the memcached statistic along with its value and will allow you to hand pick the OIDs that you want to track. Yes, I know it could be done simpler with <em>translate</em> instead of multiple <em>replace</em>. Left as an exercise for the Python-aware reader.</p>
<p>2. after having a complete list of OIDs use this one-liner:</p>
<p><em>/usr/bin/python -c &#8220;import memcache; print &#8216;##&#8217;.join(memcache.Client(['127.0.0.1:11211'], debug=0).get_stats()[0][1].values()).replace(&#8216;##&#8217;,'\n&#8217;)&#8221;</em></p>
<p>The memcached statistics will be displayed in the same order, but only their values not their names.</p>
<p>And this is the mandatory eye candy:</p>
<p><img src="http://www.jroller.com/resources/a/aspinei/mem1.png" alt="" width="432" height="179" /><br />
<img src="http://www.jroller.com/resources/a/aspinei/mem2.png" alt="" width="426" height="171" /><br />
<img src="http://www.jroller.com/resources/a/aspinei/mem3.png" alt="" width="432" height="178" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/monitoring-memcached-with-cacti/tools/20060802/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

