Memcached Backend

Memcached is a distributed memory object caching system. WordPress 2.0 can make use of memcached by dropping in a special backend for the WP object cache. The memcached backend replaces the default backend and directs all cache requests to one or more memcached daemons. You must have a memcached daemon running somewhere for this to work. Unless you’re managing the server on which your blog is running, you probably can’t run a memcached daemon, making this backend useless to you. The memcached backend is targeted at ISPs and those running WPMU. If you are using WPMU and distributing DB requests across multiple servers, memcached will come in very handy. Using memcached for a single blog isn’t really worth it. In my tests, it was sometimes slower than using the default object cache backend.

To install, copy object-cache.php and memcached-client.php to your wp-content/ directory.

To configure, define $memcached_servers in wp-config.php. This is an array of host and ports to which to connect. By default, the backend attempts to connect to port 11211 on the localhost.

Example server config:

$memcached_servers = array('192.168.1.1:11211', '192.168.1.2:11211');

Comments are closed.