Question

I have a store with 300k products, I set up the reindex to be "Update by Schedule",

But I don't know what is the best way for reindexing, Should I do this manually by SSH command every 24 hours by this command

php bin/magento indexer:reindex

Or I have to set up a cron job to do reindexing. if i set up the cron job what is he good period.

My concern is, if I set up a cron job each 1 hour, Reindexing takes about 30 minutes to finish, in this case, every one hour I will be blocked for 30 minutes.

Anyone can help me at this point, What I have to do?

Was it helpful?

Solution

Starting with version 2.2, Magento creates a crontab for you. they add the Magento crontab to any configured crontab for the Magento file system owner. In other words, if you already set up crontabs for other extensions or applications, we add the Magento crontab to it.

based on this article on Magento website

http://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-cron.html

you only need to install the cronjob by this command

php bin/magento cron:install --force

The first command in the cron list (magento cron:run) reindexes indexers and your data will always be up to date.

this helped me a lot of understanding indexing via cron job, I hope it will help other people

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top