Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit f3d8f2b

Browse files
authored
Update indexer-batch.md
Added new info about how to set batch size trough environment variables
1 parent e374b6b commit f3d8f2b

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/guides/v2.4/extension-dev-guide/indexer-batch.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,41 @@ The following examples illustrate how to define a custom batch size for configur
104104
</type>
105105
```
106106

107+
### Setting batch size through environment variables.
108+
109+
Starting from 2.4.3 its possible to configure the batch size through the environment variables or in `app/etc/env.php` file for `cataloginventory_stock`, `catalog_category_product`, `catalogsearch_fulltext`, `catalog_product_price`, `catalogpermissions_category`, `inventory` indexers.
110+
111+
Example of configuration in `app/etc/env.php`
112+
113+
```php
114+
<?php
115+
return [
116+
'indexer' => [
117+
'batch_size' => [
118+
'cataloginventory_stock' => [
119+
'simple' => 200
120+
],
121+
'catalog_category_product' => 666,
122+
'catalogsearch_fulltext' => 333,
123+
'catalog_product_price' => [
124+
'simple' => 200,
125+
'default' => 500,
126+
'configurable' => 666
127+
],
128+
'catalogpermissions_category' => 999,
129+
'inventory' => [
130+
'simple' => 210,
131+
'default' => 510,
132+
'configurable' => 616
133+
]
134+
]
135+
]
136+
];
137+
```
138+
139+
Size for `catalog_category_product`, `catalogpermissions_category`, `catalogpermissions_category` batches can be setup for all product types only.
140+
Size for `cataloginventory_stock`, `catalog_product_price`, `inventory` can be set up for each product type. Also, if there is no batch size for a specific product type, the `default` value will be used. It is recommended to set the `default` value for each indexer so that there can be different batch sizes per product type.
141+
107142
## Indexer Table Switching
108143

109144
Magento optimizes certain indexer processes to prevent deadlocks and wait locks caused by read/write collisions on the same table. In these cases, Magento uses separate tables for performing read operations and reindexing. As a result of this table switching process, customers are not impacted when you run a full reindex. For example, when `catalog_product_price` is reindexing, customers won't be slowed down as they navigate on Categories pages, search products, or user layer navigation filters with price filters.

0 commit comments

Comments
 (0)