Skip to content

Instantly share code, notes, and snippets.

@andrewguy9
Created August 14, 2013 22:02
Show Gist options
  • Select an option

  • Save andrewguy9/6236109 to your computer and use it in GitHub Desktop.

Select an option

Save andrewguy9/6236109 to your computer and use it in GitHub Desktop.

Revisions

  1. Andrew Thomson created this gist Aug 14, 2013.
    6 changes: 6 additions & 0 deletions long_running.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    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>)