I am using Sequelize ORM for connecting databases using NODE JS and PostgreSQL. When I request concurrently to the server it's throwing an error ConnectionAcquireTimeoutError [SequelizeConnectionAcquireTimeoutError]: Operation timeout. So, I search it how to fix this issue. many of the given solutions to increase to acquire count or increase the connection pool count. is it the right solution?
Sequalize Config
pool: {
max: 5,
min: 0,
acquire: 30000,
idle: 10000
}
Sequelize Version : 6.6.2
When I increase the acquire count and connection pool count it's throwing same error
You can use the param retry in Sequelize option to handle what to do if you got this error
Also, there is a tricky thing with Sequelize, if you use transactions (I think you do) you should not use await/async but promise transactions
If your transaction use await/async, your maximum concurrent transaction will be your pool.max value, so any n+1 transaction will be rejected by a deadlock
If your transaction use Promise, your n+1 transaction will be queued (more delayed than queued) and will not be deadlocked
https://lightrun.com/answers/sequelize-sequelize-deadlock-on-multiple-transactions
it should solve some of your problem :)