I have a serverless application with Firebase functions and a Google Cloud SQL Postgresql database.
The application triggers some Firebase functions through a PubSub topic and each trigered function connects to the database using psycopg2. There can be multiple functions running at once. Each function opens a connection, executes the query, and closes the connection.
However, in the middle of execution the new connections start to raise connect timeout exception. For example, the first 5 queries run, but it stops working on the 6th. I’m not using any connection pool and I’m closing the connections after the queries are run.
Do you guys have some theories on what could be happening? Or how could I learn more about it?
Thanks!
1