Mysql – Connection to thesql server in SYN_SENT

MySQLrhel5tcp

We are facing a strange problem from last few days between our application server and database server(Mysql): connection to database server from application server hangs in SYN_SENT state and after that we are not able to make any connection to database server on mysql port(3306). When we checked the netstat output on database server its in SYN_RECV state.

What I can figure out is mysql server is receiving the SYN request and responding also and its not reaching to the client hence SYN_RECV at server side and SYN_SENT at client side.
I think SYN_SENT state should go after some time and because of this other db connection attempts to same server should not hang.

Does anybody have any idea how can we resolve this issue?

Out setup details :

Application server: RHEL 5.4, kernel-release = 2.6.18-164.el5, x86_64

Database server: Mysql Version : 5.1.49
RHEL 5.4, kernel-release = 2.6.18-164.el5, x86_64

Best Answer

I had this problem with my provider in evenings. It looks like some router in the chain between you and target host doesn't proper work with tcp_sack. The solution is to disable it in /etc/sysctl.conf

net.ipv4.tcp_sack = 0

But this is very bad for server, because it will slow down tcp connections. You should make abuse to your provider