You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Knex version: "^3.1.0"
Database + version: MariaDB -- 10.4.28-MariaDB
OS: Windows 10 64 Bit
Issue Explaining
Until yesterday, I was using node-mysql2. I was getting "Too many connections" error when using node-mysql2. I did not attempt to solve this error until today, thinking it was a minor problem. I tried a lot of solutions by doing research and I was checking whether it was solved or not by looking at the following command:
SHOW STATUS LIKE '%onn%'
The output would always be the same. Threads_connected, Connections and Max_used_connections would always increase, never decrease.
** Although I don't know exactly, I think the "Too many connections" error is caused by one of these 3 pieces of information. Please correct me if I'm wrong.
When I couldn't figure it out, I discovered knex. It was obvious that knex was a very comprehensive library. I thought this would solve the problem, but the result was the same. I'm not quite sure what I can do anymore.
Does the "Too many connections" error occur when one of these 3 values reaches 151?
Is it normal that these 3 values constantly increase and never decrease?
If they should decrease, why don't they decrease at all? I think there is no problem in my code.
Environment
Knex version:
"^3.1.0"
Database + version: MariaDB -- 10.4.28-MariaDB
OS: Windows 10 64 Bit
Issue Explaining
Until yesterday, I was using node-mysql2. I was getting "Too many connections" error when using node-mysql2. I did not attempt to solve this error until today, thinking it was a minor problem. I tried a lot of solutions by doing research and I was checking whether it was solved or not by looking at the following command:
SHOW STATUS LIKE '%onn%'
The output would always be the same.
Threads_connected
,Connections
andMax_used_connections
would always increase, never decrease.When I couldn't figure it out, I discovered knex. It was obvious that knex was a very comprehensive library. I thought this would solve the problem, but the result was the same. I'm not quite sure what I can do anymore.
Error message:
Too many connections.
Codes
db.js
users-repo.js
These are the codes I used in the first test. In my second test I just added this and the result was still the same:
First Test Results
The first query when I run the project with
yarn dev
:After a few queries
After waiting 5 minutes
Second Test Results (with
db.destroy()
)The first query when I run the project with
yarn dev
:After a few queries
After waiting 5 minutes
The text was updated successfully, but these errors were encountered: