magento-lts
magento-lts copied to clipboard
High usage of redis hget with attribute group_price
Preconditions (*)
- Product attribute
group_priceinstalled
Steps to reproduce (*)
- Visit product page
Result (*)
After we installed the group_price attribute, it really slowed down our product page by many calls to redis hget:

To fix it, I disabled (rewrite) the method Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract::afterLoad.
Here is newrelic backtrace where I spotted the problem:

what exactly do you mean by "Product attribute group_price installed" ?
@tmotyl I mean this attribute: https://github.com/OpenMage/magento-lts/blob/1.9.4.x/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php#L127
What did you do to install/enable/disable it?
@joshua-bn I did this:
class MyRewrite extends Mage_Catalog_Model_Product_Attribute_Backend_Groupprice {
public function afterLoad($object) {
return $this; //afterload disabled due to poor performance
}
}
So is this the function that's causing the problem? https://github.com/OpenMage/magento-lts/blob/1.9.4.x/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php#L221-L252
probably the loadPriceData()?
@fballiano yes the link points to the problematic function