Knowledgebase: Umbrellar Support
Magento Memcache Configuration
Posted by Daniel Pooley on 10 November 2015 02:58 PM

This knowledge base article applies to the Umbrellar Low Density Shared Hosting plans.

What is Memcached?

Memcached (Mem-Cache-D) is a general-purpose distributed memory caching daemon. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source (such as a database or API) must be read. This can greatly increase the speed of websites, such as Magneto that heavily utilise database resources.

Disambiguation: Memcached vs Memcache

Memcached is the name of the server-side daemon; memcache is the name of the PHP extension that adds the libraries that create the PHP functions for communication with the daemon there is also a PHP library called memcached, which also facilitates communication with the daemon. The memcached PHP extension is often see as the successor to the memcache extension as it implements more memcache functions and is actively under development. In the below configuration example, we will be utilising the memcached PHP extension.

How do I configure Magento to use Memcached?

1. Open the main Magento configuration file (app/etc/local.xml) in text editor and paste the following configuration just after the '<global>' XML tag.

<cache>
    <backend>memcached</backend>
    <memcached>
        <servers>
            <server>
                <host>![CDATA[/var/www/vhosts/example.com/memcached/example.com.sock]]</host>
                <port>![CDATA[0]]</port>
                <persistent>![CDATA[1]]</persistent>
                </server>
            </servers>
            <compression><![CDATA[0]]></compression>
            <cache_dir><![CDATA[]]></cache_dir>
            <hashed_directory_level><![CDATA[]]></hashed_directory_level>
            <hashed_directory_umask><![CDATA[]]></hashed_directory_umask>
            <file_name_prefix><![CDATA[magento_]]></file_name_prefix>
    </memcached>
</cache>

Note: the example.com domain name is used in the above configuration; you will have to update this to your domain name.

Once the above has been completed your Magneto installation will be utilising Memcached and you should see an increase in performance.

 

(5 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).