1

Back-end architecture: Spring-boot Application + nodeJS server + Azure Mariadb server. The nodeJS server is used to quickly provide data from the DB for initial syncing of the application.

It had been working fine but lately, few queries for certain users take over 60 to 90 seconds. I tried reproducing it on a copy of prod DB but I got the results pretty fast (< 1 or 2 seconds).

Further I tried profiling the query directly on the db server through terminal which returned results in < 1 sec.

What could be the reason for the queries to run slow through the server even when fast on terminal?

Aman Kumar
  • 11
  • 2
  • Can you catch your production MariaDB server in the act of running one of those slow queries? To do that, start the query from your app and then say `SHOW PROCESSLIST;` to a MySQL client program. Look for the ID of the process running your slow query. Then, quickly, get the [EXPLAIN output](https://mariadb.com/kb/en/explain/) by saying `SHOW EXPLAIN FOR id;`, substituting the actual ID. Then [edit] your question to show us that EXPLAIN, the offending query, and the output from `SHOW CREATE TABLE whatever;` for the tables involved. – O. Jones Jul 06 '22 at 11:26
  • How long does `SELECT 1;` take in each environment? (I am fishing for the network latency.) – Rick James Jul 06 '22 at 19:00
  • Found the answer ?? Stuck on a similar problem . – Shrihari Feb 21 '23 at 19:40

0 Answers0