[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