I have been working on this project for a client for a few weeks now, but I seem to be stuck. They have a large inventory (about 50,000 products), each with about 15 fields. Some of these are entity reference fields that link to other items on the site (some content types, other related products, etc). I imported them all successfully using commerce feeds. I used feeds itself to import the product displays for these products. Again, all 50,000 worked correctly all all fields show. However, the issue is when I try to edit one of these (the product display or the product). I get a white screen of death after about 60 seconds. I tried raising the max_execution_time to 3 minutes. Still didn't work. Sometimes I would get a 'Allowed memory size of X bytes exhausted (tried to allocate Y bytes)' error as well. I raised the memory limit which seemed to fix that error, but the white screen still shows and I get the maximum execution timeout error again. It does the same thing when I import about 2,000 nodes of another content type.

I checked the logs, and it seems like the last item it gets stuck on is one of these:

field_sql_storage_field_storage_load() /xxxxxx/includes/module.inc:0
DatabaseStatementBase->fetchAllAssoc() /xxxxxx/includes/entity.inc:192

Editing or adding nodes of different types is fine. It seems to be just the ones I imported. I know 50,000 is a lot of products/nodes, even 2000 nodes is a lot, but I still feel that a node/*/edit or a commerce/products/*/edit should work instantly. I also tried importing only 50 nodes out of the 2000 for that content type. It let me edit those nodes, but it took longer than it should have.

This might not have anything to do with feeds at all, but I am not sure where else to start. Any ideas?

Comments

MegaChriz’s picture

Status: Active » Fixed

It sounds like that when you go to an edit page of the node or the commerce product that all other nodes/products get loaded. My first guess would be that this has something to do with the entity reference fields. Check which widget type you use for these fields. If it is "Select list" then it's quite possible that Drupal is trying to load 50,000 entities when entering the edit page. If so, set this to "Autocomplete".

If you have counted out the entity reference field as possible cause, then my other guess would be that (some of) the items you imported are extremely huge (many MB's big). I think this would rare though. You aren't importing the contents of a whole book into a single field, for example?

Last thing to check would be the PHP memory limit. I've read somewhere that a memory limit of at least 256 MB is advised for a Drupal site with Drupal Commerce.

I hope this helps you further.

MegaChriz’s picture

Category: Bug report » Support request
tlo450’s picture

Sure enough it was the entity reference fields. I had the select list option widget selected for them. I can't believe I didn't that of that...thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.