I am now running a PostgreSQL inside a Docker inside a EC2, and a Node.js instance is connecting to it.
I recently found that the connection is becoming slower. Before, restarting the instance only need a few seconds to establish the connection. But now, it requires about 30+ seconds.
I wonder what could be happening there and how can I optimize it. It never happened to me before.