Skip to content

Indexer Manager

Module: Magenx_IndexerManager · admin only

Extends Magento’s own System > Tools > Index Management page. You can reindex from the admin without waiting on the page, see how far behind each scheduled indexer is, and keep a log of every reindex, whoever started it. It warns you, and can email you, when a reindex fails or a backlog keeps growing.

The Index Management grid with actions, last run and backlog columns
System > Tools > Index Management.
AdditionWhat it does
Actions columnReindex (queued), Details (the last 10 runs), and switching between Update on Save and Update by Schedule.
Reindex now (queued) mass actionQueues a full reindex for each selected indexer. An indexer already queued or running is skipped with a message.
Last Tracked RunTime, duration and status of the latest full reindex, with the error for a failed one.
Schedule StatusShows the backlog, for example IDLE (123 in backlog), counted up to 10000+.
Schedule UpdatedWhen the indexer last processed its backlog.
Live refreshThe grid updates itself while anything is running, and pauses while the tab is hidden.
WarningsA banner when a queued reindex is waiting too long (the queue consumer isn’t running), and when a backlog has stayed too high.
  • A reindex started in the admin goes through a message queue, so the page returns at once.
  • Every full reindex, from the admin, bin/magento, cron or another module, takes a per-indexer lock. If one is already running, the second is skipped and logged as skipped. bin/magento indexer:reindex reports an error instead of claiming a rebuild that never happened.

System > Tools > Indexer Run Log lists every full reindex: start, end, duration, status, where it was started (admin, CLI, cron, API) and by which admin. Filter, search and sort it. Optionally, it also logs the small reindexes that “Update on Save” indexers run on each save.

Clear Log deletes finished rows. An hourly job marks runs that died as error and removes rows past the retention period.

  • Failure email: when a full reindex fails, from anywhere, the recipients get an email, at most one per indexer per throttle window.
  • Backlog alert: when a scheduled indexer’s backlog stays at or above the threshold for longer than the time you set, a banner appears, and optionally an email. Checked every 5 minutes.

See the state of every index

  1. An admin user opens the index screen.
  2. Each index is listed with the platform's own columns and three new ones: - its last recorded full rebuild (time, duration and status, with the failure message if it failed), - for background-mode indexes, the background update state with the change backlog, for example "IDLE (123 in backlog)", - when its background update last ran.
  3. A backlog above 10,000 shows as "10000+".

Rebuild one index

  1. The user chooses "Reindex" on a row and confirms.
  2. A queued run is recorded for the index and the request is put on the queue. The page returns at once with "queued".
  3. A worker takes the request. The run turns running, then success with its duration, or error with the failure message.
  4. While the run is active, the screen refreshes its cells on its own (F5).

Rebuild many indexes

  1. The user ticks several indexes and chooses the bulk action "Reindex now".
  2. Each index that can be queued gets a queued run. Each one that cannot is named with the reason. The page reports how many were queued.

Rebuild refused or skipped

  1. The user asks to rebuild an index that already has an active run, or whose state is working.
  2. The request is refused with a message, and nothing is queued.
  3. Two requests can arrive in the same instant, or a rebuild can start from the command line while one is queued. When the second of these reaches the index while the first holds the exclusion lock, it is recorded as skipped with the reason. It does not run.
  4. A command-line rebuild that is skipped ends with an error message, not a success message.

Live refresh

  1. The index screen loads while a run is active, or while an index or background update is working.
  2. Every refresh interval (30 s by default), the screen re-reads the state, backlog, last-update and last-run cells, plus the worker warning. It replaces them in place.
  3. When nothing is active any more, the screen does one last update and stops polling.
  4. While the browser tab is hidden it does not poll. When the tab is shown again it polls at once, if work was active.
  5. On a screen loaded with nothing active, no polling happens.

Worker is down

  1. A queued run has waited longer than the stalled-queue limit (15 minutes by default).
  2. The index screen shows a warning with the number of waiting runs, the oldest queued time, and what to check.
  3. When a worker takes the runs, the warning disappears on the next refresh.

Switch mode

  1. The user chooses "Switch to update in background" (or "to update on save") on a row.
  2. The index changes mode. The page confirms the new mode and the row shows it.

Investigate history

  1. The user chooses "Details" on a row. A panel lists the last 10 runs of that index, of every type, with start, type, status, duration, origin, admin user and message.
  2. The user opens the history screen. They filter by index, status, origin, type and date, search the message text, sort and page.
  3. A user with the clear permission clears the history. Finished runs are deleted; active runs remain.

Failure email

  1. Failure email is on, with recipient ops@example.com and a 60-minute throttle window.
  2. A full rebuild fails from any origin. One email is sent with the index, origin, admin user, time and failure message.
  3. The same index fails again 20 minutes later: the run is recorded, and no email is sent.
  4. It fails again 70 minutes after the first email: one email is sent.

Maintenance

  1. Every hour, running runs older than the stale-run limit (6 hours by default) become error with the message "process died".
  2. Runs older than the retention period (30 days by default) are deleted.

Backlog alert

  1. The backlog threshold is 1,000 entities, the time limit 30 minutes, and backlog email is on.
  2. At 10:00 a backlog check reads 1,500 for "product price", a background-mode index. Its backlog episode starts at 10:00. No warning is shown yet.
  3. Checks at 10:05 to 10:25 still read 1,000 or more. The episode continues and keeps its 10:00 start.
  4. The 10:30 check finds the episode 30 minutes old. The index screen shows a backlog warning naming "product price", its last count, and that it has been over the limit since 10:00. One email goes to the failure-email recipients.
  5. Later checks while it stays over send no further email.
  6. At 11:10 a check reads 600. The episode ends and the warning disappears from the screen at its next load or refresh.
  7. If the backlog goes over the threshold again, a new episode starts with a new timer, and it may send a new email, within the throttle window.

These always hold:

  • At most one full rebuild of an index executes at any moment, whatever the origins.
  • A failure of history recording, email or the status source never changes whether a rebuild runs or how it ends. The rebuild's own error is what its caller sees.
  • No admin request runs a full rebuild.
  • With the feature off, every rebuild behaves exactly as the platform's own, and the index screen shows exactly the platform's own columns and values.
  • Clearing or pruning history never removes a run that a waiting worker request refers to, except by retention.
  • Each rebuild that reaches the index records at most one run. A queued request and its execution share one run.
  • Duration is finished minus started, in seconds to 3 decimals. On screen it shows as "0.4s" or "12.3s" under a minute, "4m 05s" under an hour, and "1h 02m" from an hour up.
  • Change backlog is the number of distinct entities changed after the index's last processed change, counted up to 10,001. Up to 10,000 it is shown as a number, above that as "10000+". If the backlog cannot be read, the cell shows the state without a count.
  • Backlog colour, while the background update is idle: notice for ≤ 10, minor for 11–100, major for 101–1,000, critical above 1,000. While not idle it is always minor.
  • The screen is active while any of these holds: any index state is working; any background update is working; any active run was created within the stale-run limit.
  • An email may be sent for an index if none was sent for it before, the throttle window is 0, or at least the throttle window has passed since the last email for it.
  • Origin is admin for admin-panel requests and for worker runs of admin requests; scheduled task for runs inside the scheduler; API for other web requests; command line otherwise.
  • Stale: status running and started before now minus the stale-run limit. Stalled: status queued and created before now minus the stalled-queue limit.
  • All stored times are in UTC. Only display converts them.
  • Backlog episode, per check and index: a count at or above the threshold keeps the current episode, or starts one at this check. A count below the threshold ends it. A count that cannot be read keeps the episode as it was, and never starts one. An index in alert = its episode started at least the time limit ago (at or before now minus the limit).
  • "Did the last rebuild of this index work, how long did it take, and who started it?" can be answered from the index screen alone.
  • Every admin-requested rebuild is attributed to the admin user who requested it, including when a worker runs it.
  • A run never stays running for longer than the stale-run limit plus one hour.
SituationWhat happens
Two admins request a rebuild of the same index in the same instant, and both requests pass the refusal check.One run executes. The other is recorded as skipped (lock held). The index is rebuilt once.
A command-line rebuild starts while a worker rebuilds the same index.The command-line rebuild does not run, is recorded as skipped, and ends with an error message.
The scheduled "rebuild invalid indexes" task reaches an index that a worker is rebuilding.That index is skipped quietly; the task goes on with the other indexes.
Index state is working, but no process holds the lock (a dead process).The rebuild is skipped with a message on how to reset the index. A new admin request is refused while the state stays working.
The worker process dies mid-rebuild.The lock is released. Within the stale-run limit plus one hour, the run becomes error with "process died".
No worker runs, and a request has waited 16 minutes, with a 15-minute limit.The warning shows 1 waiting run and its queued time.
History storage is unavailable during a rebuild.The rebuild runs and ends as it would without this feature. The recording failure is logged.
Mail delivery fails.The rebuild outcome is unchanged. The failure is logged. The throttle is not advanced, so the next failure tries again.
The rebuild fails with a 10,000-character message containing markup.The message is stored at ≤ 2,000 characters and shown as text everywhere. The email holds ≤ 4,000 characters, escaped.
A background-mode index has 2,000,000 changed entities.The cell shows "10000+". Counting stops at 10,001.
A background-mode index has no change record yet.The cell shows the state without a count; no error.
Recording is set to failures only, and an admin-requested rebuild succeeds.The queued run is removed on success. Nothing remains in the history.
Full-rebuild recording is off, and an admin requests a rebuild.The run is visible as queued and running while active. It is removed on success, and kept on error.
The history is cleared while a request is queued.The queued run remains. The worker completes it normally.
Bulk "Reindex now" over 5 indexes, 2 of which have active runs.3 are queued. Each of the other 2 is named with its reason.
A queued request names an index that was removed by a later deployment.Its run becomes error with "unknown index". The worker does not fail.
The feature is switched off while 2 requests are queued.Both rebuilds run when taken, unrecorded. Their queued runs are removed.
Partial-rebuild recording is on, and a save triggers a partial rebuild of 3 entities that fails.One run of type list with 3 entities and status error is recorded. The save sees the original error. No email is sent.
Retention 30 days with 200,000 runs older than that.All are deleted in batches of ≤ 5,000 within one pass.
Retention 0.Nothing is deleted, ever.
A stored refresh interval of 2 s.The screen polls every 10 s.
The browser tab is hidden for an hour while a rebuild runs.No polls while hidden. One poll runs when the tab is shown again.
Backlog reads exactly the threshold (1,000 with threshold 1,000).The episode starts; the threshold counts as over.
Backlog stays at 1,500 for 29 min 59 s with a 30-minute limit.No warning and no email yet.
Backlog drops to 999 for one check, then returns to 1,500.The first episode ends. A new one starts at the later check, with a new timer.
The backlog cannot be read at one check during an episode.The episode and its start time are unchanged.
An index in alert is switched to update on save.Its episode is dropped at the next check, and the warning no longer names it.
Backlog email is on but failure email is off.Warning shown; no email. Once failure email is switched on, the next check of the same episode sends one.
A failure email for an index was sent 10 minutes ago, with a 60-minute throttle, and the index now enters backlog alert.The backlog email is sent: the two kinds are throttled separately.
Threshold set to 0 while 2 indexes are in alert.The stored episodes are cleared and the warning disappears.
2,000,000 changed entities with threshold 10,000.The count reads 10,001, the episode starts, and the warning shows "10000+".
  • Every index declared on the installation, by the platform or any extension.
  • Full rebuilds from every origin; partial rebuilds only when that recording is on.
  • Global scope only.
  • Changing what an index contains or how a rebuild works internally.
  • Defining new indexes, or ordering and grouping rebuilds into chains.
  • Scheduling rebuilds at chosen times; the platform's own scheduled tasks stay as they are.
  • Starting, supervising or restarting the background worker, or the operating-system scheduler that triggers it.
  • Resetting an index that a dead process left stuck in "working"; the feature only reports it.
  • Admin inbox notifications, chat or webhook alerts; email only.
  • Per-store settings: indexes, the queue and the scheduler are per installation.
  • Any storefront feature or storefront API.
Terminal window
composer require magenxcommerce/module-indexer-manager
bin/magento module:enable Magenx_IndexerManager
bin/magento setup:upgrade
bin/magento setup:di:compile # production mode only
bin/magento cache:flush
  • PHP ~8.4.0||~8.5.0, Magento 2.4.8.

Then run bin/magento setup:static-content:deploy in production mode.

The queue uses your installation’s queue connection: RabbitMQ when configured, otherwise MySQL. Magento’s consumer cron starts the magenxIndexerReindex consumer. If env.php limits cron_consumers_runner/consumers, add it to the list, or run it as a service:

Terminal window
bin/magento queue:consumers:start magenxIndexerReindex

Default scope only.

Stores > Configuration > Magenx > Indexer Manager

General

SettingDefaultScopeNotes
Enable
magenx_indexer_manager/general/enabled
YesGlobalYes/No. No: the Index Management grid shows only the core columns, nothing is logged, locked or queued, and no email is sent.
Live Refresh Interval (seconds)
magenx_indexer_manager/general/refresh_interval
30GlobalText. Shown when Enable = Yes. How often the Index Management grid re-reads indexer status while a reindex is queued or running. It does not poll when nothing is running, or while the browser tab is hidden. 10 to 3600.

Run Tracking

SettingDefaultScopeNotes
Track Full Reindex Runs
magenx_indexer_manager/tracking/full
YesGlobalYes/No. Logs every full reindex, whether started from the admin, bin/magento, cron or an API call.
Track Row/List Reindex (on-save)
magenx_indexer_manager/tracking/partial
NoGlobalYes/No. Logs the single-entity reindexes that "Update on Save" indexers run on every save. One extra database write per indexer per save. Leave off unless you are diagnosing slow saves.
Log Failures Only
magenx_indexer_manager/tracking/failures_only
NoGlobalYes/No. Yes: successful and skipped runs are not kept. A running full reindex is still visible while it runs.
Log Retention (days)
magenx_indexer_manager/tracking/retention_days
30GlobalText. The hourly maintenance cron deletes log rows older than this. 0 keeps them forever.
Stale Run Timeout (hours)
magenx_indexer_manager/tracking/stale_hours
6GlobalText. A run still marked as running after this long is marked as an error with the message "process died". Set it above your longest full reindex.

Reindex Queue

SettingDefaultScopeNotes
Consumer Stalled Warning After (minutes)
magenx_indexer_manager/queue/stalled_minutes
15GlobalText. The Index Management page warns that the magenxIndexerReindex consumer is not running when a queued reindex has waited longer than this.

Backlog Alert

SettingDefaultScopeNotes
Backlog Threshold (entities)
magenx_indexer_manager/backlog/threshold
1000GlobalText. A scheduled index whose backlog stays at or above this many entities raises the alert. 0 switches the alert off. At most 10000, the most the backlog count reads.
For Longer Than (minutes)
magenx_indexer_manager/backlog/minutes
30GlobalText. How long the backlog must stay at or above the threshold before the Index Management page shows a warning. Checked every 5 minutes by cron, so an alert can show up to 5 minutes late.
Email the Alert
magenx_indexer_manager/backlog/email
NoGlobalYes/No. One email per index each time its backlog goes over the limit, to the Failure Notifications recipients and within its throttle. Needs "Email on Failure" set to Yes.

Failure Notifications

SettingDefaultScopeNotes
Email on Failure
magenx_indexer_manager/notifications/enabled
NoGlobalYes/No. Sends an email when a full reindex throws, from any context. Works whether or not the run is logged.
Recipients
magenx_indexer_manager/notifications/recipients
emptyGlobalText. Shown when Email on Failure = Yes. Comma-separated addresses. Leave empty to send no email.
Email Throttle per Indexer (minutes)
magenx_indexer_manager/notifications/throttle_minutes
60GlobalText. Shown when Email on Failure = Yes. At most one email per indexer in this window; further failures in it are only logged. 0 sends one for every failure.
Email Sender
magenx_indexer_manager/notifications/email_identity
General ContactGlobalDropdown. Shown when Email on Failure = Yes.
  • Magento_Backend::system_tools > Indexer Run Log

Grant these under System > Permissions > User Roles > Role Resources:

ResourceUnderID
Indexer ManagerSystem > ToolsMagenx_IndexerManager::indexer
Manage Indexers (reindex, change mode)System > Tools > Indexer ManagerMagenx_IndexerManager::manage
View Run LogSystem > Tools > Indexer ManagerMagenx_IndexerManager::log
Clear Run LogSystem > Tools > Indexer Manager > View Run LogMagenx_IndexerManager::log_clear
Indexer Manager SettingsStores > Settings > ConfigurationMagenx_IndexerManager::config
JobGroupDefault scheduleChange it at
magenx_indexer_manager_maintenancedefault23 * * * *Fixed
magenx_indexer_manager_backlog_checkdefault*/5 * * * *Fixed
TermMeaning
IndexA store of derived data the platform keeps in step with source data, identified by a unique index code and a title.
Index stateWhat the platform records about an index: ready, reindex required, working (a rebuild is in progress), or suspended.
Full rebuildRecomputing an entire index from its source data.
Partial rebuildRecomputing one entity (row) or a list of entities, as an index set to update on save does after each save.
ModeHow an index follows source changes: update on save (partial rebuild during each save) or update in background (changes are recorded and processed later by a scheduled task).
Change backlogFor an index in background mode, the number of distinct entities changed since it last processed its changes.
Background updateOne pass of the scheduled task that processes an index's change backlog. Its state is idle, working or suspended.
QueueThe platform's asynchronous work queue. A queued rebuild waits there until a worker takes it.
WorkerThe background process that takes rebuild requests from the queue and runs them.
Exclusion lockA per-index lock held for the whole of a full rebuild. Its holder releases it when the rebuild ends or the process dies.
RunOne recorded rebuild: a history entry.
Run statusqueued (requested, waiting for a worker), running, success, error (the rebuild failed or its process died), skipped (not started, because the index was already being rebuilt).
OriginWhere a run was started: admin (the admin panel, including runs a worker performs for an admin request), command line, scheduled task, or API (any web request outside the admin panel).
Active runA run in status queued or running.
Stale runA running run older than the stale-run limit, whose process is assumed dead.
Stalled queueA queued run that has waited longer than the stalled-queue limit.
Throttle windowThe minimum time between two emails of the same kind for the same index.
Backlog thresholdThe backlog size, in entities, at or above which an index counts as backed up.
Backlog time limitHow long an index must stay backed up before it is in backlog alert.
Backlog episodeOne continuous stretch during which an index stays at or above the backlog threshold. It starts at the first check that reads the backlog at or above the threshold. It ends at the first check that reads it below, or when the index leaves background mode.
Backlog alertThe state of an index whose current backlog episode is older than the backlog time limit.
Backlog checkOne pass of the scheduled task that re-reads every background-mode backlog and updates the backlog episodes.