Slow performance, slow and long running crons
In Adobe Commerce and Magento Open Source, enabled flat catalog tables and indexers can lead to slow site performance and long-running cron jobs. Disable the flat catalog configuration and flat indexers to restore normal indexing behavior and improve performance. To resolve the issue, disable flat catalog settings and indexers.
Description description
Environment
- Adobe Commerce on cloud infrastructure 2.1.x and later
- Adobe Commerce on-premises 2.1.x and later
- Magento Open Source 2.1.x and later
Issue/Symptoms
- Experience heavy SQL load and site performance issues.
- Observe long-running cron jobs.
- Observe stuck cron jobs.
Cause
Flat tables and indexers remain enabled.
Resolution resolution
Follow these steps to resolve the issue:
- In the Admin, go to Stores
>Settings>Configuration. - In the left panel under Catalog, select Catalog.
- Expand the Storefrontsection and complete the following actions:
- Set Use Flat Catalog Category to No.
- Set Use Flat Catalog Product to No.
- Click Save Config, and refresh the cache when prompted.
- Flush the cache by running
php bin/magento cache:flush. - If you can’t set Use Flat Catalog Category and Use Flat Catalog Product to No because the options are unavailable, disable the flat indexers in
app/etc/config.php:
- Set all indexers to Update by schedule by running
php bin/magento indexer:set-mode schedule. - Edit
app/etc/config.php, locateflat_catalog_productandflat_catalog_category, and change their values from1to0. - Import the configuration by running
php bin/magento app:config:import. - Confirm that the flat indexers are disabled by running
php bin/magento indexer:status. - Flush the cache by running
php bin/magento cache:flush.
experience-cloud-kcs-help-kbarticles