akeneo / magento2-connector-community

Akeneo Connector for Magento 2
Open Software License 3.0
81 stars 88 forks source link

Admin Panel Configuration times out when you have a huge amount of categories/attributes in Akeneo #597

Open Hexmage opened 2 years ago

Hexmage commented 2 years ago

When you have a very large amount of categories in Akeneo the Magento backend times out. Because requesting all the categories takes too long.

Environment and configuration

  1. Magento 2.4.2
  2. Akeneo 3.2.83 (but most likely irrelevant)

Steps to reproduce

  1. Create 1500 categories in Akeneo
  2. Configure the Magento Environment to connect to the Akeneo environment.
  3. Try to reopen the configuration page in the magento backend.

Expected result

  1. Configuration loads.

Actual result

  1. Configuration pages gets a 504 timeout.

The most likely cause of the issue is that Categories are fetched one by one through the Akeneo api. Which although fast individually is very slow in large quantities. I would suggest fetching them in batches of 100 and then processing those.

It seems that products are fetched the same way during the import. Which could cause time outs in automated cron jobs if enough products get changed at the same time (like restructuring your categories, which is what I'm doing now).