Unexpected EOF in Golang Mysql Connection pool

Hi Team,

I am creating connection pool in golang with below configuration…

db.SetMaxOpenConns(1000)
db.SetMaxIdleConns(100)
db.SetConnMaxIdleTime(time.Minute * time.Duration(3))
db.SetConnMaxLifetime(time.Hour * time.Duration(1))

In the meanwhile, I am creating 10000 go routines they will do database updates… I am getting
[mysql] 2022/02/18 17:54:34 packets.go:37: unexpected EOF and
[mysql] 2022/02/18 17:26:35 packets.go:37: read tcp : read: connection timed out

Frequently and missing updates… What the code does is below

result, err := db.Exec(query, params)

Kindly advice, what configuration I am missing or I have to implement lock and unlock for getting connection ?

check if your connection keep alive for long time, and try to see this links

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.