So I have the following setup:
Server - t2.micro ECU Ubuntu instance Database - t2.micro RDS MySQL instance.
The stack is a basic LAMP stack with default Apache settings.
I am basically running a web crawler. I've setup some methods to run on the server based on a cronjob. I've noticed that after several minutes, the DB connections slowly rise to ~60, which I think might be too many. After 60, when I run: show processlist;
I get all the connections are command "Sleep", and the EC2 instance is unresponsive. I cannot ssh into it, and its pretty much unresponsive until I Stop/Start the instance, which changes the IP address and causes like 45 minutes of maintenance before its up again.
I know it probably has to do with the max number of connections, but I am confused why the EC2 instance crashes...? I monitor all the stuff on EC2 and RDS dashboards and nothing but 'DB connections' is going above the limit, EC2 seems like it doesn't even care, its at like 5% load on everything.
The application isn't logging any information, only access.log and errors.log are running and they don't seem to be full, is there something I haven't considered?