<ul>
<li>Chris Wanstrath helped scaling gamespot</li>
<li>had to turn off gzipping to avoid burning the cpus</li>
<li>3000 req/seconds</li>
<li>50M pages in the day, no downtime</li>
<li>Chris is a sloppy programmer (jk)</li>
</ul>
<ul>
<li>a distributed hash with no each or keys – just get and set</li>
<li>written in c – fast</li>
</ul>
<ul>
<li>at first – you dont need <a href="https://www.danga.com/memcached/">memcached</a> – YAGNI</li>
<li>unless you really do need it - you have a millions of views, you have a huge DB, you have really ugly sql</li>
</ul>
<ul>
<li>the standard pattern—try the cache first, if its not there, grab it from the DB and set it in the cache</li>
<li>use memcached-client, not ruby-memcache</li>
<li><a href="https://require.errtheblog.com/plugins/browser/cache_fu">cache-fu</a> = acts_as-cache 2.0</li>
<li>don’t use DNS names for the servers – always use ip’s</li>
<li>expire_cache – issues a delete to the cache</li>
<li>get_cache – duh, grab from the cache</li>
<li>so after_save :expire_cache</li>
</ul>
<ul>
<li>you dont ever cache nil – since that screws ruby. cache_fu will cache false behind the scenes</li>
<li>get the DB down to 0.0% </li>
<li>Model.cached(:finder)—wraps the idiom of caching a custom finder</li>
</ul>
<ul>
<li>can do Model.get_cache(1,2,3) to do a get_multi call to memcached ( ie get many objects in parallel)</li>
<li>can do a before_filter to force all cache misses when a url gets a magic query string </li>
<li>but be careful – don’t crash your site</li>
<li>use reset_cache!</li>
</ul>
<ul>
<li>need :version to invalidate old version of AR models—otherwise you get screwed when you do a migration</li>
<li>libketama – developed by lastfm guys so you can throw memcache servers in and out w/o invalidating all your keys</li>
<li>the perl client already handles this under the covers, the ruby client doesn’t</li>
<li>someone should implement libketama in ruby, to make big memcached installations safer</li>
</ul>