-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
tcp_keep_alive_timeout seems not set for MySQL connection #63659
Comments
In fact, this problem does not only exist on the MySQL connection, TCP protocol also has problems. If there is packet loss between client and server during disconnect connection. |
It is good guess about packet loss when client closes the connection. But I doubt that it could happen often. FIN packages are retransmitted. It more likely could be incorrect client shutdown, like sigfault. I would appreciate to see logs from client and server and some diagnostic if there is a NAT between client and server. |
Regardless, half-connection can occur for a variety of reasons. Seems that the tcp_keep_alive_timeout is not configured to the tcp socket. |
We handle timeout for tcp connection here: ClickHouse/src/Server/TCPHandler.cpp Lines 322 to 330 in 0ebca16
tcp_keep_alive_timeout does not bring any value to track timeout if Could you provide actual settings value for |
Thanks for the quick reply We configured idle_connection_timeout=3600, it did not take effect neither. Regarding the reason why idle_connection_timeout did not take effect. In this case, LB (the load-balancing component mentioned earlier) will only ① create TCP and ② send RESET. It will not go through the whole CK connection creation process (such as account/password verification etc.). For this situation, we can only relay on tcp_keep_alive, let operation system help us to clean the old connections. |
Could you tell me please actual value of After accept call server calls receiveBytes on socket. That operations could hung up to |
I have made a simple experiment.
So I do not understand your case. Are you sure that |
We just do not use tcp keep alive for the server. We rely on
|
Hi guys:
Our production environment encountered a case. There are many semi-connection found on the ClickHouse server.
These connections are created by our Load-Balancing component when performing health detection.
These connection has exited on the client side. However, they remain on the clickhouse side.
I looked through the 23.8 open source code and found that keep_alive is not set for the socket in the tcp and mysql protocols, even though I configured tcp_keep_alive_timeout.
The text was updated successfully, but these errors were encountered: