Menu rebuilding on a large system is very very very slow... (>20min)

commerce_product_ui_menu generates submenus for every product type

stats on our system

mysql> select count(*) from commerce_product;
+----------+
| count(*) |
+----------+
|  1170177 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from commerce_product_type;
+----------+
| count(*) |
+----------+
|      801 |
+----------+
1 row in set (0.00 sec)

mysql>

unusable at all

Comments

podarok’s picture

damien tournoud’s picture

Issue tags: -frontend performance

Product types are bundles, which means they are part of the entity configuration, which means that they need to stay in limited number. Drupal will load all of them in memory mostly at every page request.

We probably don't actually need to generate the submenu here, but it is probably the least of your concern (even if I don't see the entries added by commerce_product_ui_menu() as explaining why the menu rebuild takes 20 minutes...). I would recommend auditing the memory usage around your site.

andypost’s picture

@Damien product types is really hard bottleneck because most of computer hardware shops has a lot of types and each of the types has own set of fields and attributes

Field_UI also adds it's own tabs and menu grows tremendously...

podarok’s picture

with 800+ product types
with 2000+ fields (common and uniq)
with 1400000+ products
with 800+ uniq views
with 800+ uniq feeds
memory usage not more than 750Mb for php

PS. but I had to make a few patches to commerce_product_ui, commerce_ui, field_ui for disabling redundand menu and tabs generation for UI.
And also using dfw for disabling a few hooks

rszrama’s picture

Would you care to share the patches? Perhaps there's a way to make the creation of menu items alterable in instances like yours, or maybe we could just release an alternate Product UI module for high performance scenarios. That's why we split the UI modules out from the API modules after all. : )

podarok’s picture

I think I can... after a fixing other troubles like #1165826: field_info_fields cache workaround fail

damien tournoud’s picture

Status: Active » Closed (won't fix)

You are trying to bend Drupal 7 out of its design specifications. There is nothing we can do in Drupal Commerce itself.