Feature #211
Updated by Daniel Curtis over 11 years ago
With the addition of a load balancer and multiple instances of the same parts2.altservice.com site on different servers, I needed to have session data stored at a central location to be accessed by each web server. Currently I use memcached, which Magento supports through the Zend Framework. So adding support is done by making sure that the @php.ini@ has the following information: > [Session] > session.save_handler = memcached > session.save_path = "tcp://yourMemcachedIP:11211" This sets PHP to use memcached for session storage. Next the @app/etc/local.xml@ in the Magento directory local.xml must be edited to define memcached storage: <pre><code class="xml"> <config> <global> <install> <date></date> </install> <crypt> <key></key> </crypt> <disable_local_modules>false</disable_local_modules> <resources> <db> <table_prefix></table_prefix> </db> <default_setup> <connection> </connection> </default_setup> </resources> <session_save><![CDATA[memcache]]></session_save> <!-- db / memcache / empty=files --> <session_save_path><![CDATA[tcp://X.X.X.X:11211?persistent=1&weight=2&timeout=10&retry_interval=10]]></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[private]]></session_cache_limiter><!-- see http://php.net/manual/en/function.session-cache-limiter.php#82174 for possible values --> <cache> <backend>memcached</backend><!-- apc / memcached / xcache / empty=file --> <slow_backend>database</slow_backend> <!-- database / file (default) - used for 2 levels cache setup, necessary for all shared memory storages --> <slow_backend_store_data></slow_backend_store_data> <!-- 1 / 0 (default) - used for 2 levels cache setup, sets whether store data in db slow cache backend --> <auto_refresh_fast_cache>1</auto_refresh_fast_cache> <!-- 1 / 0 (default) - used for 2 levels cache setup, sets whether refresh data in fast cache backend --> <memcached><!-- memcached cache backend related config --> <servers><!-- any number of server nodes can be included --> <server> <host><![CDATA[X.X.X.X]]></host> <port><![CDATA[11211]]></port> <persistent><![CDATA[1]]></persistent> </server> <server> <host><![CDATA[X.X.X.X]]></host> <port><![CDATA[11211]]></port> <persistent><![CDATA[1]]></persistent> </server> </servers> </memcached> </cache> </global> <admin> <routers> <adminhtml> <args> <frontName><![CDATA[admin]]></frontName> </args> </adminhtml> </routers> </admin> </code></pre> And finally make sure to have the internal *+Cache Management turned off+*