-
Notifications
You must be signed in to change notification settings - Fork 34
DOCSP-47023 Connection pools #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCSP-47023 Connection pools #505
Conversation
✅ Deploy Preview for docs-golang ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
*Default:* ``None`` (no limit) | ||
|
||
* - ``waitQueueTimeoutMS``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[note for technical reviewer] Is this option still in use or is there a preferred option to this one? This was the option included in the existing FAQ.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prestonvasquez not sure if you saw this question. Was just curious because I know some drivers deprecated this option but I wasn't sure about the Go driver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions:
func main() { | ||
//start-connection-pool-uri | ||
// Connection string with connection pool options | ||
uri := "mongodb://localhost:27017/?maxPoolSize=50&minPoolSize=10&maxIdleTimeMS=30000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of using a connection string over the client options? If we keep the uri
string it should be constantized.
clientOpts := options.Client().
ApplyURI("mongodb://localhost:27017").
SetMaxPoolSize(50).
SetMinPoolSize(10).
SetMaxConnIdleTime(30 * time.Second)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I based using the connection string off the existing FAQ in the Go docs. But I can use tabs here and show the connection string approach and the client options approach. Will rework!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-47023
Staging Links
Self-Review Checklist