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:

  1. In the Admin, go to Stores > Settings > Configuration.
  2. In the left panel under Catalog, select Catalog.
  3. Expand the Storefrontsection and complete the following actions:
  • Set Use Flat Catalog Category to No.
  • Set Use Flat Catalog Product to No.
  1. Click Save Config, and refresh the cache when prompted.
  2. Flush the cache by running php bin/magento cache:flush.
  3. 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, locate flat_catalog_product and flat_catalog_category, and change their values from 1 to 0.
  • 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.

Reset stuck Adobe Commerce cron jobs manually on Cloud

recommendation-more-help
experience-cloud-kcs-help-kbarticles