Skip to content

Instantly share code, notes, and snippets.

@andrewguy9
Created August 14, 2013 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save andrewguy9/6236109 to your computer and use it in GitHub Desktop.
Save andrewguy9/6236109 to your computer and use it in GitHub Desktop.
Kill a mongodb long running qurey
Log onto bad mongo primary
Use mongotop to find bad database
Run this to find long running queries
db.currentOp()['inprog'].filter(function (t){return t.secs_running > 10}).map(function (t){return t.opid})
Kill bad ops with
db.killOp(<opid>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment