Problem:
Files are not being cached using memcached while i have refresh all cache from magento admin
.
I have installed memcached on magento
and its stats is like below and configuration done on local.xml file which is mentioned below.
please some body help to make it working.
I have doubt that something may have wrong on configuration
or memcached
.
stats
STAT pid 8897
STAT uptime 149352
STAT time 1331275345
STAT version 1.4.6
STAT libevent 2.0.17-stable
STAT pointer_size 64
STAT rusage_user 0.026995
STAT rusage_system 0.030995
STAT curr_connections 5
STAT total_connections 8
STAT connection_structures 7
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 21
STAT bytes_written 1628
STAT limit_maxbytes 536870912
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT evictions 0
STAT reclaimed 0
and i have configured the app/etc/config.xml
<config>
<global>
<cache>
<backend>memcached</backend><!-- apc / memcached / empty=file -->
<memcached><!-- memcached cache backend related config -->
<servers><!-- any number of server nodes can be included -->
<server>
<host><![CDATA[127.0.0.1]]></host>
<port><![CDATA[11211]]></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[lb-]]></file_name_prefix>
</memcached>
</cache>
<install>
<date><![CDATA[Fri, 11 Nov 2011 16:02:21 +0000]]></date>
</install>
<crypt>
<key><![CDATA[admin]]></key>
</crypt>
<disable_local_modules>false</disable_local_modules>
<resources>
<db>
<table_prefix><![CDATA[]]></table_prefix>
</db>
<default_setup>
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[username]]></username>
<password><![CDATA[password]]></password>
<dbname><![CDATA[dbnam]]></dbname>
<initStatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<type><![CDATA[pdo_mysql]]></type>
<pdoType><![CDATA[]]></pdoType>
<active>1</active>
</connection>
</default_setup>
</resources>
<session_save><![CDATA[files]]></session_save>
</global>
<admin>
<routers>
<adminhtml>
<args>
<frontName><![CDATA[admin]]></frontName>
</args>
</adminhtml>
</routers>
</admin>
First, be sure to check that the Memcache daemon is actually running
ps ax | grep memcache
Then, make sure that you have actually installed the PHP extension
Search within the document for Memcache to make sure it is actually loaded.
These are the 2 only reasons that Memcache would not be working.
To verify if Memcache is in use is very simple.
Then empty the content of the
./var/cache/*
directory, then reload a page in the frontend and observe the contents of the above directory. If it remains empty, Memcache is being used.
See http://www.sonassi.com/knowledge-base/magento-kb/what-is-memcache-actually-caching-in-magento/
take reference the following settings :
<config>
<global>
<session_save><![CDATA[]]></session_save> <!-- db / memcache / empty=files -->
<session_save_path><![CDATA[]]></session_save_path><!-- e.g. for memcache session save handler tcp://10.0.0.1:11211?persistent=1&weight=2&timeout=10&retry_interval=10 -->
<session_cache_limiter><![CDATA[]]></session_cache_limiter><!-- see http://php.net/manual/en/function.session-cache-limiter.php#82174 for possible values -->
<cache>
<backend></backend><!-- apc / memcached / xcache / empty=file -->
<slow_backend></slow_backend> <!-- database / file (default) - used for 2 levels cache setup, necessary for all shared memory storages -->
<memcached><!-- memcached cache backend related config -->
<servers><!-- any number of server nodes can be included -->
<server>
<host><![CDATA[]]></host>
<port><![CDATA[]]></port>
<persistent><![CDATA[]]></persistent>
<weight><![CDATA[]]></weight>
<timeout><![CDATA[]]></timeout>
<retry_interval><![CDATA[]]></retry_interval>
<status><![CDATA[]]></status>
</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[]]></file_name_prefix>
</memcached>
</cache>
</global>
</config>
Also, make sure PHP memcache.ini
file has been configured properly like below :
$ aptitude install php5-memcache
$ aptitude install memcached
extension=memcache.so
[memcache]
memcache.dbpath="/var/lib/memcache"
memcache.maxreclevel=0
memcache.maxfiles=0
memcache.archivememlim=0
memcache.maxfilesize=0
memcache.maxratio=0
;Use memcache as a session handler
session.save_handler=memcache
;Defines server urls to use for session storage
session.save_path="tcp://localhost:11211?persistent=1&weight=2&timeout=10&retry_interval=10"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With