gitalk icon indicating copy to clipboard operation
gitalk copied to clipboard

[译]配置 sql.DB 获得更好的性能

Open smallnest opened this issue 6 years ago • 4 comments

https://colobu.com/2019/05/27/configuring-sql-DB-for-better-performance/

smallnest avatar May 28 '19 01:05 smallnest

Hexiaopi avatar Aug 08 '19 01:08 Hexiaopi

//设置open和idle的总连接数为3 db.SetMaxOpenConns(2) db.SetMaxIdleConns(1)

这块是有问题的吧,总连接数应该等于MaxOpenConns,原文是SetMaxOpenConns=3

// Set the number of open connections (in-use + idle) to a maximum total of 3. db.SetMaxOpenConns(3)

jsyzchen avatar May 17 '20 13:05 jsyzchen

谢谢,我居然把idle的数量调的比open还大,困扰了好久

miRemid avatar Apr 03 '21 07:04 miRemid

牛逼

Yii18 avatar Mar 02 '22 09:03 Yii18