I'm using Amazon RDS Proxy for my main database for my node application. I recently noticed that in my server logs I was receiving a lot of fatal PROTOCOL_CONNECTION_LOST errors with my database instance which would cause my server to reboot (using PM2). This would of course cause a few seconds of downtime each time it reboots causing intermittent client errors. I use node-mysql to manage my database connections and I use connection pooling for my server mysql instances. Looking into my Amazon RDS Proxy logs I see a lot of instances of both:
- The client connection closed. Reason: The idle timeout was exceeded.
- The client connection closed. Reason: The TCP channel was closed by either the client or the proxy.
What exactly is causing this to happen and what can I do to stop this behaviour?
Thanks!