Reputation: 355
I have a lambda that is currently deployed on AWS. It is a simple piece of CRUD logic which sits behind a an API gateway.
The problem I am currently facing is that as soon as there is a peak in traffic the connections on my database shoot up.
I understand that this is due to the parallel invocation of many lambdas together, and opening their separate connections, but is there a way I can do some sort of connection pooling here?
The below thread states that I can(If I code a bit intelligently do some sort of a connection pool in a container):
How we can use JDBC connection pooling with AWS Lambda?
But it does not guarantee anything.
Can I do something about this in my lambda or do I have to use an external connection pooler for this(I use Postgres, so that should be pg_bouncer)?
Upvotes: 1
Views: 1680