News for hackers. Stuff that matters.
Re:Nginx and Memcached, an easy 400% boost in req/s by nostrademons on Tuesday February 12, 2008 @06:11PM (#114427)
Brad Fitzpatrick addressed that when he released the initial memcached - LiveJournal had spent about 2-3 years fiddling with MySQL caches to get decent performance. They even took out one of those MySQL support contracts and had a MySQL engineer in to troubleshoot their performance problems.

The bottom line was that yes, DBs should cache things - but they don't. The main issue was as someone else mentioned, the query cache is flushed whenever the table's written to, which makes it essentially useless on a multi-user website.

Also, memcached distributes the cache itself across multiple machines, which makes a huge difference to cache hit rates. When you have a local query or app cache in a multi-server setup, you end up with each cache storing the same data, so the size of the cache is limited by the amount of RAM you have in the machine. If you distribute the whole cache, you're limited by the amount of RAM in all machines, which means almost every request can hit the cache. Hence you have architectures like FaceBook's 3 TB memcached setup.

There are no comments on this comment yet.