Skip to content

Instantly share code, notes, and snippets.

@harshvardhanmalpani
Last active November 27, 2021 22:57
Show Gist options
  • Save harshvardhanmalpani/6528f80c117174a0edb615c93903842f to your computer and use it in GitHub Desktop.
Save harshvardhanmalpani/6528f80c117174a0edb615c93903842f to your computer and use it in GitHub Desktop.
Fixes batch size for Magento 2.2.4 and above. Put the file in app/code/[Vendor]/[Module]/etc/adminhtml/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\Catalog\Model\Indexer\Category\Product\Action\Full">
<arguments>
<argument name="batchRowsCount" xsi:type="number">1000</argument>
</arguments>
</type>
<type name="Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\BatchSizeCalculator">
<arguments>
<argument name="batchRowsCount" xsi:type="array">
<item name="configurable" xsi:type="number">500</item>
</argument>
</arguments>
</type>
</config>
@harshvardhanmalpani
Copy link
Author

This fixes the system.log error

main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. Please update innodb_buffer_pool_size or decrease batch size value (which decreases memory usages for the temporary table). Current batch size: 100000; Allocated memory size: 540000000 bytes; InnoDB buffer pool size: 1610612736 bytes. [] []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment