We have magento2 community edition 2.2.6

We are having issues with customer login for some users,

Their login takes too much time, and in database it goes in sleep queries which remains their for like 5-10 15 minutes Even if there are no past orders or anything, it takes forever to load and times out

this happens to some of the users, and we don't know what is cause of this issue, we tried to find from logs and slow query logs, but didn't find the issue,

can any body help in look in this to resolve?

  • Please add some slow & sleep query so that we can understand more
    – Amit Bera
    Aug 2, 2019 at 5:19

4 Answers 4


Ok, We solved this issue

(First we thought it was due to some extension but we disabled all extensions we installed and it was behaving same)

This comes due to old entries in quote table

We are not sure but some old inactive marked quote item for specific users were causing this delay, perhaps some bug in magento or dont know,

but we removed those entries from quote table which have the customer's email (customer who were facing the timeout issue) and it got fixed,

So basically Old entries some how magento is not be able process or get hold on properly via some queries running on post login pages, causing this issue, we accidentally found the cause while running

Mysql Show Full process list again and again while it was timing out So we checked the entry in database and found it was having customer email as logged in user, so to check I deleted that, and Bingo it was solved,

If you guys have came across similar issue and if its not solved by this method but some other method, do share your solution here

Query shows selecting quote table

  • Did you ever find a solution which stopped this happening? We're experiencing the same thing which happens over multiple customers (but not all). Clearing the quotes table isn't a good solution so I'm hoping to find out the root cause?
    – Jamie
    Aug 9, 2019 at 10:28
  • This was my issue as well, thanks! Aug 31, 2019 at 11:56
  • We can raise this issue to magento community folks, and this could be bug not sure, I am not pro, I solved this issue by fluke and not expertise. Sep 17, 2019 at 7:13
  • @Jamie no I could not, perhaps we are clearing those data which are one month older to keep up, as this keeps happening for some customer and every-time those are random customer and not the same one. I think it has something to do with checking permissions? it is stalling there, as when we run this query on console, it doesnot take more then few micro seconds if some one know about what does it means please help out Sep 17, 2019 at 7:18

We faced the same issue with (apparently) random customer accounts and @Govind's answer helped us out a lot.

What I've noticed is that you don't even need to remove the entry entirely from the database table, it's enough that you set the is_active flag to 0 for the customer's quote in the quote table.

We did not dig deeper into the issue, but obviously the error seems to be quote-related, so perhaps the customer had some products in the basket that are no longer available etc.

Thankfully for us - changing the is_active flag solved our issue for the problematic customers.


If you use another API call that take some time means all pages are taking time. For example your using P21 Integration on ur website, that api getting the response of timeout then all pages are slow.

  • Not sure what do you mean by P21 integration, but this was happening to some particular users only, and not all, so if there was something like this it would have been for everybody. Aug 2, 2019 at 10:25

yes indeed, using the below SQL

-- check locked

select customer_email from quote where is_active = 0;

-- unlock

UPDATE quote set is_active = 1 where is_active = 0;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.