[DRIVERS-361] Atlas Users Experience Poor Performance on AWS Lambda Created: 15/Mar/17  Updated: 27/Oct/23  Resolved: 05/Jan/18

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Bryan Reinero Assignee: Matt Broadstone
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

MongoDB and Atlas users are experiencing poor performance when using MongoDB from AWS Lambda Functions. This is likely due to a current inability to persist connection pools between execution of Lambda functions, thus a connection pool must be created for each execution.

I imagine Lambda provides some type of execution context which users can persist mongoclient instances to be referenced for subsequent operations. The drivers may need to be modified to make use of this persistent context.



 Comments   
Comment by Matt Broadstone [ 05/Jan/18 ]

This can be (and has been) solved through documentation, no work needed for drivers.

Comment by Raphael Londner [ 15/Mar/17 ]

Lambda functions are supposed to be stateless but in reality, a container running a specific Lambda function might be reused for close, consecutive function calls. This might allow the code to reuse a db connection that was previously opened (provided it hasn't been closed).

Heard from sigfrido.narvaez that Python Lambda functions would allow re-use of the database connection across calls (provided that connection has not been closed in a previous function call).

With Node.js however, it looks like the db connection must be closed after being used or the Lambda function times out, which prevents it from being re-used on subsequent calls.

Generated at Thu Feb 08 08:21:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.