Slow Login for admin accounts


#1

Hi

I am about to go live with new reactioncommerce website.

I have noticed that the admin login is becoming really slow lately, it takes about 30 seconds.
Looking at it with the kadira debugger learns that, out of the box, admin accounts load all the inventory and accounts documents.
Looking into the source i noticed they have a general subscription on inventory and accounts. Right now it is taking about 20 second to download these. 7000 documennts in total.
I’m affraid if this number grows, when it goes live, it would become impossible to login.

The other accounts log seems to be ok, just the admin.

My questions:

  • Do you think these collections/subscriptions (inventory/account) could be the source of my slow, admin account only, logins?
  • Does anyone have some experience with these issues? ( and How did you fix this? :slight_smile: )
  • I can disable the inventory module, right?
  • But for accounts that is kind of difficult isn’t it? I’m thinking template subscriptions here?

Any help and pointers are greatly appreciated. :slight_smile:

Kind regards,
Shane Smith


#2

Is there both 7000 products or 7000 accounts?
The inventory collections makes an entry for each variant/product qty (so 1 product with qty 20 = 20 documents). That’s likely the biggest offender… we subscribe all here I think because the admin user on product update inserts new inventory records. This should probably be just subscribed for a product where you are viewing details.

The other issue could be that we really don’t need to subscribe to all user accounts, we really only want the ones that are not “anonymous”, and the subscriptions should be limited to if you are viewing the accounts page. The quick fix would be to add a limit to the subscription and infinite scroll /pagination for getting additional accounts.

I’d suggest that we need to create an issue for this, and we can fix in the next release, as these are both issues that others have made temporary patches for but we need to fix in core.


#3

thank you so much, Aaron.

inventory is about 1100 documents (500 products/variants)
i think anonymous accounts must be the biggest factor (6000+), i wil limit these for now.
{'emails': { $exists: true, $not: {$size: 0} } }

that should reduce it to around 13 :slight_smile: