Some Magento store admins report that Magento is returning this exception when using memcached as a backend for either the Magento cache or the Magento Full Page Cache. This issue has its roots in the Zend Framework which returns this exception if memcache fails to return its extended stats.
To resolve this is fairly simple. All you need to do is edit the file [Magento root]/lib/Zend/Cache/Backend/Memcached.php and replace the getFillingPercentage() method with the below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
public function getFillingPercentage() { $mems = $this->_memcache->getExtendedStats(); $memSize = null; $memUsed = null; foreach ($mems as $key => $mem) { if ($mem === false) { $this->_log('can\'t get stat from ' . $key); continue; } $eachSize = $mem['limit_maxbytes']; $eachUsed = $mem['bytes']; if ($eachUsed > $eachSize) { $eachUsed = $eachSize; } $memSize += $eachSize; $memUsed += $eachUsed; } if ($memSize === null or $memUsed === null) { $mem = $this->_memcache->getstats(); if (isset($mem['bytes']) and $mem['limit_maxbytes'] > 0) { return ((int) (100 * ($mem['bytes'] / $mem['limit_maxbytes']))); } } else { return ((int) (100. * ($memUsed / $memSize))); } return 100; } |
What exactly does this do?
It will make an additional attempt to get the filling percentage and if it cannot determine the filling percentage then 100 is returned which indicates it is full. In this way there will not be an exception thrown during the temporary periods when filling percentage cannot be determined.
Quick Extension Overview
Full Page Cache reduces your Magento store’s First Byte Time, Increases your web server request rate, reduces database load, and makes your store much more responsive. Extendware’s Caching solution is the best Magento Caching Performance Extension you can buy to speed up your store and easily pays for itself by saving you money rather than buying expensive hardware solutions to increase your Magento store optimization rates.