Mongoid is slow and shows this in the log: MONGODB cursor.refresh() for cursor 3474711247518436755

喜欢而已 提交于 2019-12-11 17:10:04

问题


I am using admin_assistant and have hacked on MongoDB support. The only issue now is that the index page queries are incredibly slow. admin_assistant uses will_paginate for these queries. I verified that the exact slow-down spot is where the will paginate collection is first accessed (.empty?). In the log I see the query, and after that I see these being slowly printed:

MONGODB cursor.refresh() for cursor 3474711247518436755
MONGODB cursor.refresh() for cursor 3474711247518436755
MONGODB cursor.refresh() for cursor 3474711247518436755
MONGODB cursor.refresh() for cursor 3474711247518436755
MONGODB cursor.refresh() for cursor 3474711247518436755
MONGODB cursor.refresh() for cursor 3474711247518436755
MONGODB cursor.refresh() for cursor 3474711247518436755
MONGODB cursor.refresh() for cursor 3474711247518436755
MONGODB cursor.refresh() for cursor 3474711247518436755
MONGODB cursor.refresh() for cursor 3474711247518436755

I will probably try getting rid of will_paginate next, but the rest of the code is depending on it right now. Any ideas on what could cause the cursor refreshes?


回答1:


Thanks for your comments, rubish!

I switched from will_paginate to kaminari and everything works now.



来源:https://stackoverflow.com/questions/7339695/mongoid-is-slow-and-shows-this-in-the-log-mongodb-cursor-refresh-for-cursor-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!