Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to kill dead cursors in MongoDB

When querying a MongoDB collection, if the read will take a while, the cursor times out. There's a timeout=False option, which makes the cursor not time out, and then it must be closed manually.

When a script crashes with an open cursor, that cursor presumably just stays alive in the DB until the next restart. In the MMS monitoring dashboard, these are visible as a high constant in the "cursors" chart.

mms cursors

What are the consequences of this? And how can I kill these cursors manually?

like image 289
user831885 Avatar asked Jan 28 '15 23:01

user831885


1 Answers

As noted by wdberkeley, this doesn't currently exist, but is a new feature requested in https://jira.mongodb.org/browse/SERVER-3090.

like image 172
user831885 Avatar answered Oct 23 '22 01:10

user831885