Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my local machine I use a MySQL client to connect to a remote MySQL server (an Amazon EC2 instance). I tested many many client, but all of them freezes (I have to force close them) if I try to perform any operation after some minutes I did anything (idle).

I'm asking if the server can perform some type of timeout, or if is there a reason it can freeze on some query performing.

I have to say the website running on the server continue to work without any problems, so there is something wrong in the remote connection.

Here is my my.cnf:

During freeze CPU is not used on the server:

ubuntu@ip-10-48-239-133:~$ top
  686 mysql     20   0  874m  66m 5100 S  0.0 11.3  36:55.78 mysqld

And connections are ok:

ubuntu@ip-10-48-239-133:~$ netstat -tup
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 ip-10-48-239-133.:mysql MY.LOCAL.IP:59633       ESTABLISHED -               
tcp        0      0 ip-10-48-239-133.:mysql MY.LOCAL.IP:58964       ESTABLISHED -               
tcp        0    384 MY.LOCAL.IP:45745       ESTABLISHED -               
tcp        0      0 MY.LOCAL.IP:54109       ESTABLISHED -          
share|improve this question
up vote 2 down vote accepted

It's probably a timeout on the connection table in a stateful firewall in between the clients and server. You don't say what OS is running on the clients. If it's Linux, then try reducing tcp_keepalive_time

share|improve this answer
Client is running on a Xubuntu 12.04 in my office network (can't tell you know about firewalls here), server is running on Ubuntu Server 12.04 LTS on Amazon EC2 behind standard Amazon firewall. I will try to change tcp_keepalive_time asap. Thank you. – lorenzo-s Aug 27 '12 at 13:19
Seems to work now. Thank you. – lorenzo-s Sep 17 '12 at 10:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.