2

As we know, reindexing will use a lot of resources and make the magento slowdown during the process. So, I was thinking, if there any possibilities to run reindex from different server. For example, I have magento running on server A. So, I have also server B only to execute the reindex. The reindex process only happened in server B. Yes it doesn't make any sense if I think of this way. btw, Is it possible? Is there any other way to avoid low performance of magento during the reindex process?

4

No, it won't work.

PHP is single threaded, at worst, your reindex will occupy a single core at 100% - which is nothing to worry about.

What reindexing does do however, is apply locks on the database, and have it perform several intensive queries which no matter how many web servers you have, is going to have an effect on your entire stack.

There's two really simple things you can do to improve poor indexing performance,

  1. Just get proper hosting, sized appropriately for your store
  2. Don't reindex. Well, not during production hours anyway. Just have a single batch process run nightly via cron to perform the task and set them all to manual
  3. Do not install a third party indexing module, reindexing asynchronously won't do anything other than cause random erratic periods of downtime throughout the day

This is all relative really, as indexing strategy can be a challenge for high transacting stores or large catalogue stores.

But if you are processing less than 100 orders per hour, or have less than 20k products - it shouldn't be a bottleneck.

1

Yes it is possible. But: a) you have to reindex not only on a other servers. You have to do it on a different database and copy reindex tables. This makes it tricky to script it. b) You can not do it for all indexers because to many tables are affected

We do it for the longest running index: Catalog URLs. The easy thing is: Only one table - core_url_rewrite - is affected.

Pseudo Code:

  • Dump whole database and import on a different database on a physical different server.
  • Run reindex process
  • Rename table core_url_rewrite to core_url_rewrite_new
  • Dump table
  • Import renamed table on your live database
  • Rename your live table to core_url_rewrite_old (to have a backup)
  • Rename reindexed table to core_url_rewrite

You have to do the renameing process to have a backup and because import maybe takes a while.

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.