In the Magento 1.4 release, the memcached backend configuration has changed. There are now more options listed than in previous Magento versions. Some confusion has resulted in how to configure memcached in this new version as the previous configuration for memcached no longer works resulting in the Magento site failing to load if used. Documentation on this new configuration is scarce, so some research must be done to understand its implementation.
The new local.xml.additional memcached portion that comes standard in Magento now looks like this:
[code language=”xml”]
[/code]
Magento now uses a two-level caching system for it’s configuration. Looking at the Zend online documentation, the two-level caching mechanism can be understood. It is explained here under the Zend_Cache_Backend_TwoLevels section:
“This (extend) backend is an hybrid one. It stores cache records in two other backends : a fast one (but limited) like Apc, Memcache… and a “slow” one like File, Sqlite…”
To get memcached up and working, this configuration can be used:
[code language=”xml”]
[/code]
This new configuration is similar to the old one with some changes. The
It is worth noting that the
To further decrease the chances that Magento would fail as result of a memcached failure, Magento does support multiple distributive memcached servers. You can run multiple memcached instances on the same server on different ports (or unix sockets) or if your store is running on multiple servers in a cluster environment, you can run a separate memcached instance on each server. In both of these cases, a single memcached failure will not result in the site going down. A distributive configuration can be placed with in the
[code language=”xml”]
Please remember to always follow good security practices and never run memcached on an external public ip address. Always run memcached on a local unix socket or localhost. If a clustered environment exists with a private internal network that is in no way accessible from the internet, memcached may be set to listen on those private interfaces.