Skip to main content
1 of 3
laketuna
  • 6.9k
  • 7
  • 40
  • 82

Console command becomes increasingly slow

I have a CSV file with about 6K SKUs that I need to loop through to update the products in Magento 2. I'm having issue where the product saves become increasingly slow, so much so that after letting it run for 24 hours, it's still not done.

I checked memory_get_usage and memory_get_peak_usage, and it hovers around 275MB for the duration, so it doesn't seem to be memory related.

I'm saving the products using ProductRepository::save. I'm stepping through the stack, and I see saving the product attributes is slow. Dispatching the events seem to be even slower, but have no idea why the saving comes to a crawl noticeably only a 100 or so SKU update. I tried production mode.

Any ideas?

laketuna
  • 6.9k
  • 7
  • 40
  • 82