在 MongoDB Native 驱动程序上配置理想的 maxPoolSize
MaxPoolsize在杂种量的默认值为100。 如何知道默认值100是否是最佳值?是否有一个公式,一种计算方法来确定理想的MaxPoolsize?
多谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
MaxPoolsize在杂种量的默认值为100。 如何知道默认值100是否是最佳值?是否有一个公式,一种计算方法来确定理想的MaxPoolsize?
多谢。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
池大小仅取决于您使用的驱动程序,对于node.js最小值为
5
,默认值为最大值为100(默认值)。池尺寸有助于使DB的并发请求,这取决于您需要从应用程序创建的并发连接(可以打开的查询)。您可以根据用法增加它 - 您必须一次使用DB进行100多次连接,否则您需要进行一些连接以进行长期运行的任务等。
这些连接当然是基于您正在运行的服务器DB开。 Mongo Atlas确实提供了某些一次可以具有多达1500个连接的群集。
您应该检查帖子以查看它如何影响应用程序性能。
The pool size is solely dependent on the driver you are using, for Node.js minimum is
5
which is default and the maximum is 100(default).Pool size helps to make the concurrent requests to the DB and it depends upon how much concurrent connection(queries you can run on) you need to create from the application. You can increase it based on your usage- that you have to need more than 100 connections at a time with DB or you need some connections for long-running tasks etc.
And these connections are of course based on the server that you are running the DB on. Mongo atlas does provide certain clusters that can have up to 1500 connections at a time.
You should check this post to see how does it impact application performance.