Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High usage of redis hget with attribute group_price #1516

Open
midlan opened this issue Apr 2, 2021 · 6 comments
Open

High usage of redis hget with attribute group_price #1516

midlan opened this issue Apr 2, 2021 · 6 comments
Labels

Comments

@midlan
Copy link
Contributor

midlan commented Apr 2, 2021

Preconditions (*)

  1. Product attribute group_price installed

Steps to reproduce (*)

  1. Visit product page

Result (*)

After we installed the group_price attribute, it really slowed down our product page by many calls to redis hget:
image

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:
image

@midlan midlan added bug performance Performance related labels Apr 2, 2021
@midlan midlan changed the title High usage of redis hget in Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract::afterLoad High usage of redis hget with attribute group_price Apr 2, 2021
@tmotyl
Copy link
Contributor

tmotyl commented Apr 2, 2021

what exactly do you mean by "Product attribute group_price installed" ?

@midlan
Copy link
Contributor Author

midlan commented Apr 2, 2021

@joshua-bn
Copy link
Contributor

joshua-bn commented Apr 2, 2021

What did you do to install/enable/disable it?

@midlan
Copy link
Contributor Author

midlan commented Jul 21, 2021

@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
    }

}

@fballiano
Copy link
Contributor

fballiano commented Aug 28, 2022

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()?

@midlan
Copy link
Contributor Author

midlan commented Aug 28, 2022

@fballiano yes the link points to the problematic function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants