packets.go:123: 关闭错误的空闲连接:连接被对等方重置

huangapple go评论103阅读模式
英文:

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

问题

我正在使用Go语言、Fiber Web框架、MariaDB 10.6、Debian 11和github.com/go-sql-driver/mysql来连接MariaDB。我已经尝试了以下设置:

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

即增加了这些值、减少了这些值,但仍然每分钟收到1或2个警告:

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

有什么建议吗?答案是我之前的wait_timeout设置为20秒,interactive_timeout设置为50秒,我将其增加后问题解决了,感谢@ysth提供的解决方案。

英文:

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

答案1

得分: 0

答案是,我等待超时时间为20秒,交互超时时间为50秒。我已经增加了超时时间,问题已经解决。感谢@ysth提供的解决方案。

英文:

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

huangapple
  • 本文由 发表于 2023年1月3日 21:34:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/74994085.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定