7 months ago

Slow queries/connections with Eloquent, always over 1600ms

Posted 7 months ago by cristian9509

I have two Lumen apps in production (both AWS, EC2) and from time to time I see random queries that take exactly over 1600ms. I am using DB::listen to log the query including the time it takes to complete. I've been looking into the Eloquent code but I don't find anything. Maybe the reconnect if someone the connection was lost could cause a delay but why is it always over 1600ms? It just does not make any sense.

Has anyone seen this before or would anyone have ideas what to look for?

Update: This is not about a single query, it's pretty much any query that runs on the app. The numbers of rows retrieved could 0, 1 or 15 (the pagination limit).

Please sign in or create an account to participate in this conversation.