Hot answers tagged

48

TL; DR - On MageStack we use Varnish, Redis (cache), Redis (sessions) and Eaccelerator/Zend OPCache (depending on PHP version) You've already got most of it understood. The cache backend, session store, opcode cache, full page cached and reverse proxy cache are all completely different. You can use different technologies for all and you can use them ALL ...


12

The "Flush Magento Cache" button will only flush out cache records based on their tags. This uses the Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG mode when calling clean on the cache backend. The "Flush Cache Storage" button will flush the entire cache backing (where the backend supports it), using the Zend_Cache::CLEANING_MODE_ALL mode when calling clean on ...


11

Yes, with the additional step of removing the lines in app/etc/local.xml that involve Redis and removing any Redis extensions that you have installed. Most likely, the only one you'd have will be Cm_RedisSession. You can disable that extension by editing the app/etc/modules/Cm_RedisSession.xml file and changing the enabled node from true to false. Your ...


11

As per as my concept Redis is most good: Memcached is Free & open source, in-memory key-value store, high-performance, distributed memory object caching system. Redis is an open-source, networked, in-memory, key-value data store with optional durability. Because of Memcached is a volatile in-memory key/value store. Redis can act like one (and do ...


9

I've created a module that will let you do more bulk operations from the admin. Clicking "Flush DB" will actually execute the flushdb command. Download: https://github.com/steverobbins/Magento-Redismanager Otherwise you have to use command line to flush them "completely"


8

I Would go for Redis + APC with Varnish on top. 'Why Redis' you ask? Read this excellent SO answer. Redis basically replaces Magento's standard file-based caching system. Since Redis is faster it'll give you some improvement on speed. Varnish actually doesn't have that much to do with the inner workings. It's put on top and caches static content so it ...


7

We user varnish and redis cache on our server and had this same error. This is the procedure we followed for a successful upgrade. composer require magento/product-community-edition 2.2.6 --no-update composer update rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* redis-cli flushdb curl -X 'PURGE' -H'X-Magento-Tags-Pattern: .*' ...


6

CM Redis Cache in 1.7.2 is not a hack, Magento just added the code by default to 1.8+ because it works so well and is implemented easily. Redis has support to have cache and session in the same server instance because of databases. In memcached you would probably start multiple instances of memcached. Memcached also has the possibility to write to disk, ...


6

I appear to have mostly eliminated our problems. However, I never actually determined the exact cause. After upgrading the the latest version of Cm_RedisSession the logging indicated that 95% of the requests that were holding the session should actually be stateless. I implemented FLAG_NO_START_SESSION in the preDispatch() to prevent Magento creating ...


6

I found the solution. For Backend cache on Redis use below sample command php bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=xxxxxxxxxxx --cache-backend-redis-db=0 For Page Cache on Redis use below sample command php bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=xxxxxxxxxxx --page-cache-redis-...


5

In case anyone sees this. I've posted this info elsewhere, but the 109 and 403 prefixes come from an MD5 hash of the path to the path/etc folder. If your folder is in different places on different servers (or the same place on different servers that are sharing a cache) you can run into problems.


5

Change your local.xml to <session_save>db</session_save> <redis_session> <!-- All options seen here are the defaults --> <host>127.0.0.1</host> <!-- Specify an absolute path if using a unix socket --> <port>6379</port> &...


5

It could be a dozen different things, and without a full overview of your entire server at that point in time, it isn't going to be possible to give a definitive answer. It could be, redis-server process at 100% CPU Due to a flush to disk of in-memory data for persistence Due to key expiration during an eviction Due to a heavy process being executed ...


5

You should be using Mage::app()->getCache()->save() as the cache gets initialised in the getCache() method by fetching the config and setting this for the cache object, whereas the Mage_Core_Model_Cache constructor does not do this, as far as I can see and it will revert back to the default caching model. Did a quick test with: Mage::getSingleton('core/...


5

A few things to try: Make sure persistent redis connections are not enabled. This can cause issues with Magento (check your local.xml file). In your redis.conf file, make sure the timeout is set to zero "timeout 0". Check your php.ini to make sure the default socket timeout is not set to some small positive number "default_socket_timeout". Check the value ...


5

This unfortunately isn't a black and white answer. So, I'll give you the pro's and cons: Memcache: hardcoded data limit (don't discard this issue, admin sessions can easily grow beyond it) stalls when saving to disk slightly worse performance Magento extension has no bot-defense Redis: Locking issues in Session::read in some stores, caused by concurrent ...


5

You should use something like this instead of the session check you are doing based on a file. //get the admin session Mage::getSingleton('core/session', array('name'=>'adminhtml')); //verify if the user is logged in to the backend if(Mage::getSingleton('admin/session')->isLoggedIn()){ //do stuff } else { echo "go away bad boy"; }


5

CAUSE: The line in question returning the exception in CRedis: https://github.com/tburry/credis/blob/master/Client.php#L991-L1002 NOTE the timeout causing because of the read meta data of the redis process stream. More than likely you've hit timeout & or memory limits possibly. More details on stream_get_meta_data: https://php.net/manual/en/...


5

You have a typo at the end of your config, you're missing a comma ',' after 'compression_lib' => 'gzip'


5

The information is incorrect. All the software you mentioned can co-exist just fine on the same server. However, note that you don't really need Memcached. If your intention to use it was for storing Magento PHP sessions - you can do the same just fine using Redis.


5

After waiting on this question, I gathered some of the concept of warm and cold cache. By caching copies of image files, CSS, and HTML documents, the origin server does not have to generate these files each time a new visitor comes to the website. This both improves page load time and decreases stress on the origin server, meaning a website can serve more ...


4

Depending on your version (I'm using 1.8 here) Cm_RedisSession_Model_Session will sleep() on certain conditions: Line 325 // Detect dead waiters if ($tries == 1 /* TODO - $tries % 10 == 0 ? */) { $detectZombies = TRUE; // TODO: allow configuration of sleep period? usleep(1500000); // 1.5 seconds } Line 364: if ($tries >= $this->...


4

You can not clear cache per store unless you specified tags for each store. Even then you would have to modify Lesti to be able to clear cache on each store view. (You would also have to do this with the regular Magento cache as well)


4

In order to stop using REDIS, you simply need to remove the references from your local.xml. It's one thing to delete and start over but your must understand what you actually needed to do. If you look you will see either one or both of the bellow sections, this is what you need to remove. Once it is removed clear your cache and you will be good to go. <...


4

You're likely hitting max_concurrency. Colin Mollenhour has made significant updates to the Redis integrations (and his Redis Session integration) in his Github repo modules. I suggest you upgrade to the most recent version, which batches SUNIONs to avoid massive wait times. Aside from this I've seen max_concurrency hit while bots are crawling. Because of ...


4

do you have these files ? app/etc/modules/Cm_RedisSession.xml app/code/community/Cm/RedisSession is it enabled? app/etc/modules/Cm_RedisSession.xml <config> <modules> <Cm_RedisSession> <active>false</active> <codePool>community</codePool> </Cm_RedisSession> </modules> </config> also use lzf ...


4

Especially for Varnish it makes sense to use and test ist during development as you can run into big problems laster. I just read Alan Kent's (Magento Chief Architect) Blogpost today where he explains the issue with Varnish: One particular note is inclusion of Varnish. A very common problem that has become apparent is developers are not testing ...


4

we had a similar error after the upgrade to 2.1.6 when deploying static files. It seemed like throwing a random exception not be able to access the redis cache. It seems to be a problem with the parallel procession of the static files compilation. For now, as a workaround, we are deploying the files with the -j 1 option, to only start one process: bin/...


4

Please try the following way using knockout js. you can add following code in your .phtml file, this will help you to resolve login issue while the cache is enabled <ul data-bind="scope: 'customer'" class="header links"> <!-- ko if: customer().firstname --> <li><a href="<?= $this->getUrl('customer/account'); ?>">...


3

The best guide that I could find is: https://www.nbs-system.co.uk/blog-2/magento-optimization-howto-en.html From Fabrizio: Two-level caching is widely used in computing. Basically it is about having a small, but fast cache that is used for the first lookup, and if the data cannot be found in the first level it will be looked up in another cache that's ...


Only top voted, non community-wiki answers of a minimum length are eligible