Magento cron and indexers: how to set them up and fix common problems
Missing order emails, stale prices and invalid indexers usually trace back to cron. Learn how Magento cron and indexers work together, how to install the crontab, and how to diagnose and fix the most common failures.
Updated 7 min read

In this article
Part 5 of 9
Running a Magento store
All partsHide
Part 5 of 9
Running a Magento store
Choosing an edition and upgrading, extending it, then keeping cron, search, cache and patches healthy.
Magento cron and indexers: how to set them up and fix common problems
You are here · 7 min read
Many Magento problems that look unrelated turn out to have the same cause. Order confirmation emails stop arriving. A price change does not appear on the storefront. Catalog price rules never start. Products added to a category are missing from search. Behind most of these is a cron job that is not running, or an indexer that has fallen behind.
When emails stop or prices do not update, a Magento cron and indexer problem is the usual cause. The guide shows how to set up the crontab, what to check when Magento cron not running is the symptom, how schedule mode works and how to speed up a slow Magento reindex.
Adobe's documentation is blunt about it: Magento depends on correct cron configuration for many important functions, including indexing, and without it "Commerce will not function as expected". Cron drives catalog price rules, newsletters, sitemaps, product alerts, currency rate updates and all Commerce emails, including order confirmations.
This guide explains how cron and indexers work together in Magento Open Source and Adobe Commerce 2.4, how to set them up correctly, and how to diagnose the most common failures. The commands come from Adobe's configuration guide as updated in 2026.
How cron and indexers fit together
Magento runs a single system cron entry every minute: bin/magento cron:run. That command reads the jobs defined by every module, writes upcoming runs into the cron_schedule database table, and executes jobs whose time has come. Adobe notes that cron effectively runs twice for any task: the first run discovers what to schedule, and a later run, at or after the scheduled_at time, executes it.
Indexers turn the normalised catalog data into flat, fast tables that the storefront reads. Each indexer runs in one of two modes:
| Mode | CLI value | How updates happen |
|---|---|---|
| Update on Save | realtime | Index data is rebuilt when an Admin user saves a change |
| Update by Schedule | schedule | Database triggers record changed rows, and the cron index group processes the backlog |
In schedule mode, which is the usual choice for production, indexing depends entirely on cron. If cron stops, the backlog grows and the storefront quietly drifts away from what the Admin shows.
Set up the Magento crontab correctly
Since version 2.2, Magento can write its crontab for you. Switch to the file system owner (all bin/magento commands must run as that user), go to the installation directory and install it:
sudo -u <file-system-owner> -s
cd /var/www/html/magento2
bin/magento cron:install
crontab -lThe result sits between marker comments. A typical entry looks like this:
#~ MAGENTO START c5f9e5ed71cceaabc4d4fd9b3e827a2b
* * * * * /usr/bin/php /var/www/html/magento2/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /var/www/html/magento2/var/log/magento.cron.log
#~ MAGENTO END c5f9e5ed71cceaabc4d4fd9b3e827a2bSome rules from Adobe's guide that prevent most cron trouble:
- Run cron on one node only. In a multi-server setup, the crontab must run on a single node.
- Use the same PHP settings for the command line as for the web server, especially memory limits.
- Remove leftovers.
update/cron.phpandbin/magento setup:cron:runwere removed in 2.4.0, anddev/tools/cron.shno longer exists. Delete any crontab lines that still call them. - Do not edit inside the markers.
cron:installdoes not rewrite an existing Magento block; usecron:install --forceto replace it. Lines outside the markers are never touched.
Diagnose cron problems
Start with the logs. Cron output goes to var/log/cron.log. Jobs with an ERROR or MISSED status are also written to var/log/support_report.log, errors are logged as CRITICAL in var/log/exception.log, and in developer mode missed jobs appear in var/log/debug.log.
Then look at the cron_schedule table, which records each job's code, status and created, scheduled, executed and finished times. A grouped query shows quickly whether jobs are running at all:
SELECT job_code, status, COUNT(*) AS jobs, MAX(executed_at) AS last_run
FROM cron_schedule
GROUP BY job_code, status
ORDER BY last_run DESC
LIMIT 50;| What you see | Likely cause | What to do |
|---|---|---|
No rows with a recent executed_at | The system crontab is missing or runs as the wrong user | Run crontab -l as the file system owner; reinstall with cron:install |
Many missed rows | Cron runs late or long jobs block the queue | Check server load and long-running jobs; consider separate cron groups |
Jobs stuck in running | A PHP process died or hangs | Look for hung processes and memory errors in exception.log |
Repeated error rows for one job | A bug or bad configuration in that job | Read the messages column and exception.log |
You can also run one group by hand to watch it work: bin/magento cron:run --group index for indexing or bin/magento cron:run --group default for everything else.
Check and configure the indexers
Two commands tell you the state of every indexer:
bin/magento indexer:status
bin/magento indexer:show-modeindexer:status shows each indexer's status, its mode, and in schedule mode the backlog size ("idle (0 in backlog)" is what you want). A large or growing backlog means cron is not keeping up; a status of "Reindex required" means the indexer has been invalidated.
To switch all indexers to schedule mode, Adobe advises putting the site into maintenance mode and disabling cron first, to avoid database locks:
bin/magento maintenance:enable
bin/magento cron:remove
bin/magento indexer:set-mode schedule
bin/magento cron:install
bin/magento maintenance:disableOne change to remember: before 2.4.8 the Customer Grid indexer supported only Update on Save. From 2.4.8 it supports both modes and defaults to Update by Schedule.
Fix the most common indexer problems
Changes never reach the storefront
If indexers are in schedule mode but changes are not picked up, the database triggers may be missing, for example after a database restore. Adobe's fix is to switch the affected indexer to realtime, which removes the triggers, and back to schedule, which recreates them:
bin/magento indexer:set-mode realtime catalog_product_price
bin/magento indexer:set-mode schedule catalog_product_priceAn indexer stays invalid
Run bin/magento indexer:reindex for the named indexer. This is a one-off rebuild; Adobe stresses that it does not replace cron. Reindexing everything can take a long time on large catalogs, so name the indexers you need.
Large imports slow everything down
Since 2.4.7 you can suspend indexers during heavy operations with indexer:set-status. A suspended indexer is skipped by cron, along with any indexers that share its index. Afterwards, mark it invalid so the next cron run rebuilds it:
bin/magento indexer:set-status suspended catalog_category_product catalog_product_category
# ... run the import ...
bin/magento indexer:set-status invalid catalog_category_product catalog_product_category
bin/magento cron:run --group indexBe careful with setting an indexer straight to valid: Adobe warns this can hide unindexed data and degrade performance.
Full reindexing takes too long
Some indexers can run in parallel. Catalog Search Fulltext and Category Product are parallelised by store view by default. The price indexer can be split by website, customer group or both, and the thread count comes from the MAGE_INDEXER_THREADS_COUNT variable. PHP's pcntl extension must be enabled.
bin/magento indexer:set-dimensions-mode catalog_product_price website
MAGE_INDEXER_THREADS_COUNT=3 php -f bin/magento indexer:reindex catalogsearch_fulltextMessage queue consumers and cron
Many asynchronous features, such as bulk actions and some imports, publish messages to a queue that consumer processes read. On standard installations, cron starts those consumers through the consumers cron group, so a broken crontab also means queued work piles up.
Consumers matter most during deployments. Adobe's upgrade guide warns that starting an upgrade while consumers are running can corrupt data. Its procedure is to remove the crontab, run bin/magento cron:run --group=consumers once by hand so remaining messages are processed, and wait until ps aux | grep 'bin/magento queue' shows no consumer processes before continuing. Reinstall the crontab when the deployment is finished.
Questions to ask your hosting provider
Managed hosting plans differ in how much control they give you over cron and PHP. Before you blame Magento for missing emails or stale indexes, confirm these points with your host:
- Does the platform allow a per-minute crontab, and under which user does it run?
- On a multi-server setup, which single node runs cron, and what happens if that node fails?
- Does the command-line PHP use the same version and memory limit as PHP-FPM?
- Is the
pcntlextension available for parallel reindexing? - Are
var/logfiles rotated, and can you ship them to your monitoring tool?
A short operations checklist
- One Magento crontab, on one node, installed as the file system owner.
- All indexers in schedule mode in production, with a backlog close to zero.
- Alerts when
cron_schedulehas no recent successful runs or many error rows. - Indexers suspended during large imports and invalidated afterwards.
- Cron removed and message-queue consumers drained before upgrades, then cron reinstalled.
Summary
When emails stop, prices lag or search results look stale, check cron first and indexers second. Install the crontab with cron:install, read cron.log and the cron_schedule table, keep indexers in schedule mode, and use the realtime-then-schedule switch to restore missing triggers. These habits fix most "random" Magento problems before customers notice them.
Frequently asked questions
How often should Magento cron run?
Every minute.
bin/magento cron:installcreates a crontab entry that runsbin/magento cron:runeach minute; Magento then schedules individual jobs itself.Should indexers use Update on Save or Update by Schedule?
Production stores usually use Update by Schedule, which processes changes in the background through cron. It requires a working crontab.
Does indexer:reindex replace cron?
No. Adobe's documentation says it reindexes one time only; you still need cron to keep indexers up to date.
Where are Magento cron errors logged?
In
var/log/cron.log, with errors also inexception.logand failed or missed jobs insupport_report.log. Thecron_scheduletable keeps a history of every job.
Sources
- Configure and run cron — Adobe Experience League
- Manage the indexers — Adobe Experience League
- Perform an upgrade — Adobe Experience League
Part 6 of 9: Running a Magento store
Next part
Previous part
Troubleshooting guideMagento6 min read
Magento OpenSearch errors: how to diagnose and fix search fast
Magento search down? Check OpenSearch health, Magento's engine settings, version support, locked indexers and read-only indices, with tested commands for each.
Comments
No comments yet. Be the first to join the conversation.
Leave a comment
Every comment is read by a moderator before it appears. Your email address is never published; it is used only to contact you about this comment.
More from Cloudsoft Zone

TutorialDevOps5 min read
GitLab CI/CD for Laravel: test, build and deploy a reviewed release to a VPS
Design GitLab CI/CD for Laravel with a reviewed PHP image, disposable MySQL checks, explicit artifacts, protected credentials and serialized VPS deployments.
By Nilesh Kushvaha

TutorialDevOps5 min read
Docker networking for web, API, database and Redis containers: names, ports and trust boundaries
Understand Docker networking through service-name DNS, container versus host ports and explicit network membership. Diagnose connectivity without publicly exposing databases.
By Nilesh Kushvaha

TutorialDevOps5 min read
Docker volumes explained: prevent database and uploaded-file loss during container changes
Use Docker volumes with explicit project ownership, correct mount targets and independent backups. Diagnose an apparently empty database before deleting or recreating retained storage.
By Nilesh Kushvaha

TutorialDevOps6 min read
Laravel Docker Compose with nginx, MySQL and Redis: separate images, workers and retained data
Design a Laravel Docker Compose stack with matching PHP/nginx artifacts, private database and Redis services, explicit worker lifecycle and retained storage contracts.
By Nilesh Kushvaha
