===== Overview ===== [[http://www.danga.com/memcached/|memcached]] is an in-memory caching layer that is used by many websites to improve performance. [[http://bradfitz.com/|Brad Fitzpatrick]] originally wrote it to help LiveJournal scale. ===== Case Studies ===== * [[http://developers.facebook.com/opensource.php|Facebook]] uses and contributes to memcached. As of April, 2008, Facebook was using [[http://www.paragon-cs.com/wordpress/?p=144|805 memcached servers]]. From the same source, Wikipedia was using 79, Flickr 14, and Fotolog 40. ===== Gotchas ===== * Ted Dziuba of [[http://www.uncov.com|uncov]] fame may [[http://teddziuba.com/2008/04/im-going-to-scale-my-foot-up-y.html|publicly mock you]] if you write a blog post about using memcached to scale your site. * memcached has a 1MB max object size. If you need to store bigger objects, split them up, store the supplemental object count in the first object and have a naming policy for the supplemental keys. (e.g. "foo" says it has 5 parts -> get "foo-2", "foo-3", "foo-4" and "foo-5" too.) * set a chunk_size that's right for your usage ===== Tips & Tricks ===== * use the multi-key get whenever you can, it's faster ===== Alternatives ===== * ===== Other Resources ==== * [[http://download.tangent.org/talks/Memcached%20Study.pdf|Presentation]] describing memcached internals. For a condensed version of the slides, check out [[http://www.igvita.com/2008/04/22/mysql-conf-memcached-internals/|this summary]].