cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.1.8 Reindex Timeout

Magento 2.1.8 Reindex Timeout

We have a Magento store that we upgraded to 2.1.8 last week. Everything seemed to be working well till then. However, after the update, I am no longer able to re-index Category Products and Product Categories. The others indexes run fine. We have added more products since then too, however, it seems like too much of a coincidence that this would stop working right after the update.

 

I have searched for an answer since last week and applied many different solutions, however nothing seems to have fixed this issue. We did not install any new extensions.

 

The server specs are as follows:

  • Managed VPS
  • Dedicated CPU: 2 cores, Xeon E5-2630 @ 2.30GHz
  • Dedicated RAM: 6 GB
  • Dedicated Storage: 100 GB on SSD
  • Monthly Data Transfer: 5000 GB (We launched this store 3 months ago, and right now do not have a lot of traffic.)

Things I have done: (I run reindex from SSH):

 

1) Increased php memory limit to 800MB.

2) Increased the Apache and FastCGI timeout limits to 900 seconds.

3) Increased the memory and CPU limits for SSH:

  • USER_MAX_CPU_SECS=900
  • USER_MAX_VIRT_MEM=800000
  • USER_MAX_RES_MEM=800000

4) I reset all indexes and ran reindex again. It did not work:

  • php bin/magento indexer:reset
  • php bin/magento indexer:reindex

5) I tried running them one by one:

  • php bin/magento indexer:reset catalog_category_product

  • php bin/magento indexer:reset catalog_product_category

I have run out of ideas and would greatly appreciate any advice and help. Thank you very much in advance.

8 REPLIES

Re: Magento 2.1.8 Reindex Timeout

@ashustonPlease check phpinfo and confirm all the updates you made are reflected or not.

Setting memory as 800MB does not work. It should be right combination. For example: 512 or 768 or 1024 or 2048.

 

Update the memory limit to 1024. Try one index at a time. Let know if it work.

 

Problem solved? Please give Kudos and Accept as Solution.

Thanks,
Tarandeep
Magento 2 Certified Solution Specialist (x2). Follow me on Twitter

Re: Magento 2.1.8 Reindex Timeout

Thanks for your suggestion. I increased the memory limit to 1024 MB and tried again. Unfortunately this did not work (got stuck), and I still have the same problem.

Re: Magento 2.1.8 Reindex Timeout

I hope you are using the correct command. One you provided in your question has reset in it. Should as below:

 

php bin/magento indexer:reindex <NAME-OF-INDEX>

 

If it does not work can you provide with a screenshot of the error you see. Did you try to take some help from your hosting provider?

 

Problem solved? Please give Kudos and Accept as Solution.

Thanks,
Tarandeep
Magento 2 Certified Solution Specialist (x2). Follow me on Twitter

Re: Magento 2.1.8 Reindex Timeout

Thank you for your reply. Yes, I have been using reindex in my command. I provided reset in my initial post, because that's the command use to 'unlock' the processing indexes after the whole thing locks up.

 

My hosting provider helped me increase memory and max execution values, however they said that's the max they can set it to. Since we don't have that many products, (about 30k) I don't think we need more than the values I outlined above.

 

There is no error per say... When I run the:

php bin/magento indexer:reindex <NAME-OF-INDEX> ;

for Product Categories and Category Prices, it just gets stuck in the 'Processing' state, until I kill the reindex process or close the SSH session. This runs fine for all other indexes. Before the upgrade, the reindexing used to take about 5-6 minutes.

Re: Magento 2.1.8 Reindex Timeout

How log do you wait for reindex to completed? Possibly it may be taking sometime and you did not wait enough.

 

How did you create product? Import CSV, Manual process or duplicating product using duplicate product in Magento admin?

 

Is it live site or test?

Thanks,
Tarandeep
Magento 2 Certified Solution Specialist (x2). Follow me on Twitter

Re: Magento 2.1.8 Reindex Timeout

How log do you wait for reindex to completed? Possibly it may be taking sometime and you did not wait enough.

 

I waited for more than 24 hours, and it was still frozen. 

 

How did you create product? Import CSV, Manual process or duplicating product using duplicate product in Magento admin?

 

I created it with CSV Import. 

 

Is it live site or test?

 

This is the live site.

 

Re: Magento 2.1.8 Reindex Timeout

I tried all of the mentions above but still it taking too much time

 

Re: Magento 2.1.8 Reindex Timeout

I found a workaround that resolved this issue. Admittedly, this is a bit of a hack and a temporary solution (because it involves changing Core Magento files which will require you to patch after each update). But it may help you too so will post it (USE IT AT YOUR OWN RISK!)

 

I have patched core file:

magentoroot/vendor/magento/module-catalog/Model/Indexer/Category/Product/AbstractAction.php

 

I have changed method, from:

protected function isRangingNeeded()
     {
         return true;
     }

to:

 protected function isRangingNeeded()
     {
         return false;
     }

Let me know if this works for you!