-
Notifications
You must be signed in to change notification settings - Fork 2.3k
sql db connection not check the server whether closed the connection ,so it caused the tcp4 sockets has many can't identify protocol or TCP localhost:11335->localhost:6379 (WAIT_CLOSED) #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I recommend max_idle_conns == max_open_conns. |
after set max_idle_conns == max_open_conns still have the same issue ,pls help me, have any idea? |
Lifetime should be less than half of wait_timeout. But I recomend 1~10sec unless your db and app is very far (e.g. 100ms RTT). Shorter lifetime makes less trouble. |
@methane it seems not working ,but when i set max_idle_conns =0 seems working . now it's closed normal. |
now start closed abnormal again. anyone has any idea? |
No enough information. Your example code demonstrates how you use config file, not how to reproduce. Error message is very normal fd shortage. No one other than you can know why it happens; your You said "WAIT_CLOSED" and I think it means "CLOSE_WAIT", but your screenshot doesn't include Minimum example to reproduce is required. |
And here is issue tracker. not "support forum" or Q&A site. |
Issue description
sql db connection not check the server whether closed the connection ,so it caused the tcp4 sockets has many can't identify protocol or localhost:54190->localhost:mysql (WAIT_CLOSED)
db open config
max_idle_conns = 5
max_open_conns = 30
max_life_time=600
timeout=600
Example code
Error log
Configuration
Driver version (or git SHA):
*78d399c - (HEAD -> master, origin/master, origin/HEAD) Implement NamedValueChecker for mysqlConn (#690)
Go version: run
go version
in your consolego version go1.9 linux/amd64
Server version: E.g. MySQL 5.6, MariaDB 10.0.20
Server version: 5.6.15-log MySQL Community Server (GPL)
Server OS: E.g. Debian 8.1 (Jessie), Windows 10
CentOS release 6.7 (Final)
The text was updated successfully, but these errors were encountered: