Skip to content

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

Merged

Conversation

stephmarie17
Copy link
Collaborator

@stephmarie17 stephmarie17 commented Jun 3, 2025

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-47023

Staging Links

Self-Review Checklist

  • Is this free of any warnings or errors in the RST?
  • Did you run a spell-check?
  • Did you run a grammar-check?
  • Are all the links working?
  • Are the facets and meta keywords accurate?
  • Are the page titles greater than 20 characters long and SEO relevant?

Copy link

netlify bot commented Jun 3, 2025

Deploy Preview for docs-golang ready!

Name Link
🔨 Latest commit 24581a3
🔍 Latest deploy log https://app.netlify.com/projects/docs-golang/deploys/68422b9b8c828100086ecb83
😎 Deploy Preview https://deploy-preview-505--docs-golang.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

*Default:* ``None`` (no limit)

* - ``waitQueueTimeoutMS```
Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

@stephmarie17 stephmarie17 marked this pull request as ready for review June 4, 2025 16:54
Copy link
Collaborator

@rachel-mack rachel-mack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions:

@stephmarie17 stephmarie17 requested review from a team and prestonvasquez and removed request for a team June 4, 2025 18:35
func main() {
//start-connection-pool-uri
// Connection string with connection pool options
uri := "mongodb://localhost:27017/?maxPoolSize=50&minPoolSize=10&maxIdleTimeMS=30000"
Copy link
Member

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)

Copy link
Collaborator Author

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!

Copy link
Member

@prestonvasquez prestonvasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@stephmarie17 stephmarie17 merged commit c7bb8c1 into mongodb:comp-cov Jun 6, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants