Search code examples
gomariadbdebiango-fiber

packets.go:123: closing bad idle connection: connection reset by peer


I am using Go, Fiber web framework, mariadb 10.6, debian 11 and github.com/go-sql-driver/mysql to connection to mariadb. I have played with these settings

db.SetMaxOpenConns(25)
db.SetMaxIdleConns(25)
db.SetConnMaxLifetime(5 * time.Minute)

ie I increase the values, decrease values but still get like 1 or 2 waring

packets.go:123: closing bad idle connection: connection reset by peer

per minute. Any suggestion?

answar was I was having wait_timeout 20 second and interactive timeout 50 second I increased now its fixed thanks to @ysth for solution


Solution

  • the answer was I was having wait_timeout 20 seconds and interactive timeout 50 seconds I increased now its fixed thanks to @ysth for the solution