MySQL Connection keeps dropping
Hello,
I have an issue with my MySQL server installed on a Linode (1GB Nanode in Frankfurt). There is nothing on that linode except the MySQL server running on a different port and a ufw firewall rule that allows ssh and mysql traffic on there corresponding ports
I use (try to actually) this setup for development. I am making Spring Boot applications. What i noticed is that after some perid lets say arround 5 minutes of inactivity spring looses connection with the server and HikariCP (lib for Java in Spring) can't reconnect
When working with a MySQL workbench it can reconnect but the process takes about a minute
When i create a loop that will constatnly query something simple to keep the session alive on every minute the connection dies after exactly one hour (2 sec differance to be exact)
Does anyone know how to fix this, its very annoying when the connection drops in the middle of the work
PS: Same behavior on mulitple devices and localnetworks networks (tested connections even from azure vps servers in North Europe)
Only thing i changed in a mysql config is the bind adress, i set it to 0.0.0.0 in order for it to allow remote connections
1 Reply
You mention that the problems occur at regular intervals and that you are using the smallest Linode plan. I don't have all the facts, but the first place I would investigate would be resource consumption. Limited memory in conjunction with hourly connection loss hints at a scheduled task getting started that is causing disruption.
Upgrading your Linode temporarily to a 2GB plan would be an easy test to see if resource limits are being hit.
You may also want to check if you have session timeouts configured in your /etc/ssh/sshd_config
file.