Skip to content

Instantly share code, notes, and snippets.

@hasantayyar
Created February 28, 2014 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hasantayyar/9266941 to your computer and use it in GitHub Desktop.
Save hasantayyar/9266941 to your computer and use it in GitHub Desktop.
#mongodb kill slow operations
function killzombie() {
if( db.currentOp().inProg){
db.currentOp().inProg.forEach( function(op){
// kill operations taking more than 2 sec. !
if(op.secs_running > 2) {
db.killOp(op.opid);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment