sort operation used more than the maximum 33554432 bytes of RAM. Add an index,or specify a smaller

生產環境mongodb 報錯,
sort operation used more than the maximum 33554432 bytes of RAM. Add an index,or specify a smaller limit

排序查詢超過最大內存32兆,添加索引或者增加內存限制

解決方法
1、創建索引

--不阻塞創建索引
db.xxxxx.createIndex({"name":1,"sex":1},{"background":1})

2、增加sort memory

--查詢當前值
db.runCommand({ getParameter : 1, "internalQueryExecMaxBlockingSortBytes" : 1 } )

--設置新值
db.adminCommand({setParameter:1, internalQueryExecMaxBlockingSortBytes:67108864})
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章