Answer the question
In order to leave comments, you need to log in
Does it make sense to use multiple connections to the same database to increase performance?
Will there be an option
db, err := sql.Open("mysql", "root:[email protected]/productdb")
// много потоков дергающие запросы db.Query
db, err := sql.Open("mysql", "root:[email protected]/productdb")
db1, err := sql.Open("mysql", "root:[email protected]/productdb")
// много потоков, половина которых дергают запросы db, вторая половина db1
Answer the question
In order to leave comments, you need to log in
No, there is already a connection pool in use.
You can specify the number of idle (IDLE) connections db.SetMaxIdleConns and the maximum number of concurrently open connections via db.SetMaxOpenConns
Does it make sense to use multiple connections to the same database to increase performance?Usually the DBMS is the slowest link. Even so, in the vast majority of architectural solutions, the DBMS is the slowest link.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question