-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: Authentication
How are you using Mongo? What version of the server and driver are you using?
- MongoDB 5.0.20 deployed at Atlas (dedicated clusters)
- MongoDB Native Node.Js driver 5.8.1 running in AWS ECS Fargate
- MongoDB-AWS database users
What is the feature/improvement you would like?
Create the AWS credential provider instance once globally.
What use case would this feature/improvement enable?
When the MongoDB client creates a new connection to increase the pool, it creates a new AWS credentials provider. Each new provider instance issues an HTTP request to the IMDS to get credentials. However, when the connection pool is grown automatically under heavy load, the IMDS service cannot fulfill all requests. As a result, the MongoDB client fails to initialize new connections and resets the connection pool.
The AWS credentials provider instance itself is implemented as a smart credentials cache. It will issue at most one request to IMDS, and will only issue another request when the credentials are about to expire.