[MongoDB] - 对于"OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM"问题的优化


背景:MongoDB v4.2.7

错误:OperationFailed: Sort operation used more than the maximum 33,554,432 bytes of RAM. Add an index, or specify a smaller limit.’ on server

修改:增加 sort memory

*** 修改当前运行时(重启MongoDB失效) ***

1. 查询现有配置

db.adminCommand({getParameter: '*'})

 

2. 更新配置(MongoDB v4.2

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

更新配置(MongoDB v4.4
参考资料:https://jira.mongodb.org/browse/SERVER-44053

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

 

*** 持久化到配置文件中(重启MongoDB有效) *** 

更新配置(MongoDB v4.2

setParameter:
  internalQueryExecMaxBlockingSortBytes: 335544320

更新配置(MongoDB v4.4

setParameter:
  internalQueryMaxBlockingSortMemoryUsageBytes: 335544320

 

参考资料

https://mobilemonitoringsolutions.com/memory-errors-mongodb-resolve/
https://www.cnblogs.com/dgshubo/p/12397775.html
https://jira.mongodb.org/browse/SERVER-44053


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM