英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论