0

I recently upgraded my magento 2 from version 2.4.3 to 2.4.4-p7 but, since the upgrade, the product save have been incredibly slow.

If I go to the admin product page and save the product without applying any change to it, just hit the save button, it takes more than 50 seconds to save. If I apply any sort of modification, it takes more than 100 seconds to save. I have a php limit of 180 seconds (which is already pretty high) so I'd like to not increase it any further. More over, the php limit was fine before the upgrade, another reason not to increase it any further.

I don't have a complex catalog: few products with few custom text attributes (all global) but I have two websites and 5 store views in total. All attributes in the store views have the "use default" checkbox checked except for short description which gets translated in each store view.

If I look at the logs, I can see no error / exception every time I hit the save button, but I do see hundreds of "cache_invalidate" logged as debug:

main.DEBUG: cache_invalidate:  {"method":"POST","url":"xxx/admin/catalog/product/save/id/xxx/type/grouped/store/0/set/4/key/xxx/back/edit","invalidateInfo":{"tags":["magento2_en_catalog_product"],"mode":"matchingAnyTag"}} []

They have all the same structure, except for the "tags" which shows the different store code (en, fr, es, ..) but each store view tag is called several times.

At first, I didn't paid too much attention to it because these logs were present even before the upgrade. But since I can find no other error/exception during the save, this is the only weird that happens and also, I cannot tell if they increased in number since the upgrade or they've always been so many.

I found a similar issue on magento github (https://github.com/magento/magento2/issues/36928), I applied the change suggested for the ImageResizeAfterProductSave observer but it didn't change anything.

As I said, I have no error nor exceptions in my logs, so I really don't know what could be blocking the save process.

2
  • Configurable products? If yes, I have a patch. I already applied to multiple clients.
    – Sohel Rana
    Commented Mar 21 at 16:12
  • @SohelRana almost.. grouped products.. can you share the patch?
    – Lou Nik
    Commented Mar 25 at 7:27

2 Answers 2

0

Create called InventoryCatalog and app/code/Vendor/InventoryCatalog/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\InventoryIndexer\Indexer\SourceItem\Strategy\Sync">
        <plugin name="priceIndexUpdater" disabled="true"/>
    </type>
</config>

Create module InventoryCatalogSearch and app/code/Vendor/InventoryCatalogSearch/etc/di.xml

    <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\InventoryIndexer\Indexer\SourceItem\Strategy\Sync">
        <plugin name="fulltextIndexUpdater" disabled="true"/>
    </type>
</config>

Create module InventoryConfigurableProductAdminUi and app/code/Vendor/InventoryConfigurableProductAdminUi/etc/adminhtml/events.xml

    <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_catalog_product_save_entity_after">
        <observer name="process_source_items_for_configurable" disabled="true"/>
    </event>
</config>

The above solution will speed up saving operations for configurable products.

For bundle product, you can check vendor/magento/module-inventory-bundle-product-indexer/etc/di.xml

0

@Sohel Rana

Hey,

Try to increase memory limit, remove unnecessary attribute from product remove unnecessary third party modules.

Thank You!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.