WordPress
Memcached
Memcached is an in-memory key-value store that WordPress can use as a persistent object cache. It is older and simpler than Redis, and it keeps nothing on disk.
How it is measured
WordPress talks to it through an object-cache.php drop-in in wp-content and a PHP extension, usually memcached or the older memcache. The daemon listens on port 11211 by default. Run echo stats | nc 127.0.0.1 11211 to read get_hits, get_misses, evictions, and bytes in use.
A useful figure is hit rate, get_hits divided by get_hits plus get_misses. Evictions above zero mean the cache is full and pushing out entries, so raise the -m memory size in the daemon config.
Worked example
A learning-management site on two web servers points both to one Memcached instance with 64 MB. After a course import, stats show 1.4 million gets, 310,000 misses, and 52,000 evictions. The hit rate is 78 percent and falling.
Raising -m to 256 drops evictions to near zero and the hit rate to 96 percent. Wp-admin course lists, which ran 60 queries a page, now run 22.
How it differs
Memcached stores strings and serialized values by key, with no persistence and no data structures. Redis can persist to disk, handle lists and sets, and expose more commands. Both can serve as the object cache for WordPress, and neither is a page cache. Memcached restarts empty, and the first requests after a restart are slow.
Common errors
Installing the daemon and no drop-in, so nothing uses it. Running memcache and memcached extensions with the wrong plugin. Sharing one instance between several sites with no key prefix, so they read each other's data. Opening port 11211 to the internet. Leaving the memory default at 64 MB on a large site.
In practice
Check the hit rate and eviction count once a week for a month. Set a unique WP_CACHE_KEY_SALT per site. Bind the daemon to localhost or a private network. If you want persistence or you already run Redis, use Redis instead.