3 ms·
Think of Lambda as one server per request, and pool (or not) accordingly. Each lambda container will only ever be serving one request at a time, but it may be
by sudhirj 9y ago
Think of Lambda as one server per request, and pool (or not) accordingly. Each lambda container will only ever be serving one request at a time, but it may be reused to serve subsequent requests sequentially.
In that light, it might make sense to use a pool size of 1, if your application already does pooling. If you've written code to run multiple database queries simultaneously, you may want to adjust accordingly, but only allocate the number of connections you expect to use in that single request.
If you're connection constrained, you might want to look at pgBouncer, whether or not you're using Lambda. It increases your connection usage efficiency to the max irrespective of whether the connections are being used by lambda or a regular server.