Mongoid 很慢,并在日志中显示: MONGODBcursor.refresh() forcursor 3474711247518436755
我正在使用 admin_assistant 并破解了 MongoDB 支持。现在唯一的问题是索引页查询非常慢。 admin_assistant 使用 will_paginate 进行这些查询。我验证了确切的减速点是第一次访问将分页集合的位置(.empty?)。在日志中我看到了查询,之后我看到这些正在慢慢打印:
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
接下来我可能会尝试摆脱 will_paginate,但代码的其余部分现在取决于它。关于什么可能导致光标刷新的任何想法?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谢谢各位的评论,垃圾!
我从 will_paginate 切换到 kaminari,现在一切正常。
Thanks for your comments, rubish!
I switched from will_paginate to kaminari and everything works now.