如何绕过 MongoDB V4.4 中每个管道的 $facet 内存 100MB 内存限制? [英] How to bypass $facet memory 100MB memory limit on each of its pipeline in MongoDB V4.4?

查看:29
本文介绍了如何绕过 MongoDB V4.4 中每个管道的 $facet 内存 100MB 内存限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 MongoDB 3.4,最近在 Beta 环境中将其升级到 4.4.我有一个使用 facet 的查询,它给出了超过 100MB 大小限制的问题.我看到 Jira 链接在这里解释了这个问题:https://jira.mongodb.org/browse/SERVER-40317

I was working with MongoDB 3.4 and recently upgraded it to 4.4 on Beta environment. I have a query using facet which is giving 100MB size limit exceeded issue.I saw Jira link explaining this issue here: https://jira.mongodb.org/browse/SERVER-40317

查询是根据用户输入动态进行的,因此很难直接对查询进行更改,我认为这是最后的手段.

The query is dynamically made based on user input so its hard to make changes on query directly I am thinking of it as last resort.

无论如何我都在寻找绕过这个限制.AllowDiskUsage 也无法按照上述链接中的说明工作.

I am looking for anyway to bypass this limit. AllowDiskUsage also doesn't work as stated in above link.

推荐答案

确认这可以解决问题:

  db.adminCommand({setParameter: 1, internalQueryFacetMaxOutputDocSizeBytes: 335544320})

受上述命令影响,RAM 限制从默认的 100MB 更改为 320MB

With the above command affected RAM limit changed from default 100MB to 320 MB

查看更改是否到位:

 use admin
 db.runCommand( { getParameter : 1, "internalQueryFacetMaxOutputDocSizeBytes" : 1 } )

此更改是临时的,要使其永久生效,您需要添加到 mongodb.conf 文件以在启动时生效:

This change is temporary , to make it permanent you will need to add to the mongodb.conf file to take effect on startup:

 setParameter:
     internalQueryFacetMaxOutputDocSizeBytes: 335544320

这篇关于如何绕过 MongoDB V4.4 中每个管道的 $facet 内存 100MB 内存限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆