问题
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