Magento, WordPress and more1 min readUpdated

Magento cron and indexers on a Gen2 server

Cron is set up for every Magento store. How to check it runs, set indexers right and clear a stuck queue.

Magento needs cron for almost everything that happens in the background: order emails, indexers, sitemaps, currency rates and cache cleaning. On Gen2 it is installed for every Magento application, running as the application's own user every minute.

Check that cron runs

  • Logs tab, Cron: recent runs of the application's cron.
  • In the admin: System, Index Management shows when each indexer last ran.
  • Over SSH: bin/magento cron:run runs it once by hand; Actions, Run cron now does the same from the console.

Indexers

ModeUse
Update by scheduleRecommended for live stores: changes are indexed by cron in small batches.
Update on saveEach save rebuilds the index at once; slow admin and heavy load on large catalogues.
bin/magento indexer:set-mode schedule
bin/magento indexer:status

A full reindex is rarely needed. Use Actions, Reindex after a large import or when an index shows Reindex required.

Stuck jobs

If many jobs pile up in cron_schedule with status running for hours, a job crashed. Open a ticket: we look at which job and clear the queue safely.

Did this solve it? If not, tell us what you see and we look at your server.

Open a ticket

Still stuck? Ask a person.

Tickets go straight to the engineers who run ShopWhizzy servers. Tell us the store, what you see and when it started, and we take it from there.