0

The cron php bin/magento cron:run is set to run every minute in our project.

Along with various other tasks it runs indexing in Magento. Indexing is part of index cron group.

For debugging purpose all cron groups, which runs can be dumped from execute method of vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php . $jobGroupsRoot variable has all the data related to these groups.

index group has following 3 cron jobs which runs re-indexing and updates mviews.

indexer_reindex_all_invalid
indexer_update_all_views
indexer_clean_all_changelogs

Now my questing is, what will be impacted if I skip/remove these 3 cron jobs when php bin/magento cron:run runs by modifying vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php(I will extend this class to modify execute method) ?

I will configure a new cron for php bin/magento indexer:reindex , which will run once or twice a day.

1
+100

The short (and obvious) answer is that rather than your indexes being updated every minute they will only be updated twice daily. What that side affects of that will be for you I guess depends on the website and concurrency of users / frequency of change.

I haven't done this myself so I can't be sure but based on my understanding here are a few examples of things that might happen:

  • Frontend inventory levels may not be accurate immediately after they are updated (orders placed, 3rd party integrations etc)
  • After a product is categorised in a category that may not come into affect in the frontend immediately after changes
  • Flat catalog data may not be up to date with recent changes and therefore changes not reflected on frontend.
  • Catalog / sales rules prices may not be accurate immediately after they are turned on.
  • New customers will not show up in admin immediately after they are created

Of course to negate this you could also turn all indexes to "Update on Save" rather than "Update on Schedule" this would slow down some frontend requests but should mean that indexes are updated as changes are made.

2
  • I would like to keep indexer to update on schedule only. Do you think above changes will break any page ? Will indexer update everything properly when it runs once or twice a day (whenever it runs in the day) or will there be any data mismatch? – amitshree Feb 10 '20 at 6:11
  • Once the indexer runs it should update the indexes correctly. There will just be a period in between changes being made and the next index that they will be out of date. If you are running the indexer twice a day this could be up to 12 hours. – Andrew Kett Feb 10 '20 at 8:20
1

Update index Group from admin that runs twice per day

Store >> Config >> Advanced >> System >> Cron

enter image description here

2
  • I would like to keep indexer to update on schedule only as update on save runs indexer whenever the data is updated and that would slow down some frontend requests. – amitshree Feb 10 '20 at 6:13
  • yes so you can use my solution for that – Ketan Borada Feb 10 '20 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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