16

In Magento 2, there are 2 methods of indexing:

  • Update on schedule
  • Update on save

I understand the differences between these two modes, but what I'm wondering (and what the documentation is not telling something about) is in what kind of situation you would choose one over the other?

So in what scenario would it be better to use 'index on schedule' and vice versa?

3 Answers 3

30

Update on Save :The index is set to update whenever a change is saved.

Update on Schedule :The index is set to update on schedule according to a cron job.

  • On a small store,Update on Save is fine and will add very little load.
  • If you have a larger store with multiple admins, working in the backend then your indexes could be getting triggered constantly. Update on Save ties up MySQL and for large stores can take hours to complete. To avoid this, it is recommended setting your indexers to Update on Schedule. Then only run the indexers as needed (via command) or via a scheduled cron task.
5
  • Hi @MoeHannadi when i enabled "Update on schedule" whether we need to set up any crons at server level except default 3 crons? Commented May 3, 2019 at 11:40
  • Hi Nagaraju. You just need the 3 default cron jobs. But make sure you set up them correctly. you can use this link for cron setup: devdocs.magento.com/guides/v2.0/config-guide/cli/… Commented May 3, 2019 at 12:30
  • Based on magemojo server, we setup magento crons syntaxes mentioned here prnt.sc/njx843 & magento admin end enabled reindex mode for stock is prnt.sc/njwwe0 Update on Schedule, so automatically product stock statuses will reindex for every minute am i correct? please clarify Commented May 3, 2019 at 12:53
  • If Update by Schedule is in use, is it required to also manually reindex for example once a day? One extension development company suggested that, but shouldn't the indexes be updated automatically when Update by Schedule is set?
    – Webninja
    Commented Mar 13, 2020 at 12:44
  • Not sure if its the same for M2 but Sonassi recommends only having "Price" and "Stock" set to update-on-save. All others should be update-on-schedule. However, this is for M1. I would assume the same should be for M2.
    – ItsJhonny
    Commented Jan 28, 2021 at 7:42
4

Update on save (realtime): Indexed data is updated as soon as a change is made in the Admin. (For example, the category products index is reindex after products are added to a category in the Admin.) This is the default.

Update by schedule (schedule): Data is indexed according to the schedule set by your Magento cron job.

Update by schedule (schedule): Using a cron job (preferred because indexing runs every minute)

Update on save : Using the magento indexer:reindex [indexer] command, which reindexes selected indexers, or all indexers, one time only

6
  • 1
    This I understand. But my main question is: in what situation would you choose for save or schedule? Commented Jul 13, 2017 at 7:56
  • See my updated answer. Commented Jul 13, 2017 at 8:39
  • I have a catalog of 1.4 lac. , I am using magento enterprise ,all index are setup manual update and having reindexing issue , products updates are not showing on frontend until i reindex using SSH, If I use script to reindex, there is no effect on frontend , what is the best solution to get the updates immediately on frond end ? what is the other best way to peform reindex except using SSH ? Commented Feb 13, 2018 at 11:59
  • Hi @MoeHannadi when i enabled "Update on schedule" whether we need to set up any crons at server level except default 3 crons? Commented May 3, 2019 at 11:42
  • when your magento is used by many operators that frequently update product and category, use Update By Schedule for Category Products and Product Categories to avoid mysql deadlock and this can cause another indexer to fail for example elasticsearch. Make sure that magento minutely cron is running. Commented Jul 11, 2019 at 8:13
2

Not sure if its the same for M2 but Sonassi recommends only having "Price" and "Stock" set to update-on-save. All others should be update-on-schedule. However, this is for M1. I would assume the same should be for M2.

Production stores

Only "Product Prices" and "Stock Status" should be set to "Update on save", all others must be manual. A cron should be configured to re-run indexes at an appropriate non-production hour.

https://www.sonassi.com/help/magento-management/index-management

1
  • Because of the improvements made to Indexing for M2, the risk of deadlocking DB and impacts to frontend customer experience have been significantly reduced. I operate an installation of 5 stores with a catalog containing around 20K SKUs and in M1, indexing was problematic. We've not had any trouble so far with M2 indexing since launching our M2 store in November 2020.
    – John Hall
    Commented Jun 1, 2021 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.